public abstract class BaseRenderer extends Object implements Renderer
Constructor and Description |
---|
BaseRenderer() |
Modifier and Type | Method and Description |
---|---|
protected void |
addKeys(Resource.Type resourceType,
Set<String> properties)
Add primary and all foreign keys for the specified resource type to the provided set.
|
protected void |
addPrimaryKey(Resource.Type resourceType,
Set<String> properties)
Add primary key for the specified resource type to the provided set.
|
protected void |
addSubResources(TreeNode<QueryInfo> queryTree,
TreeNode<Set<String>> propertyTree)
Add available sub resources to property node.
|
protected void |
copyPropertiesToResult(TreeNode<QueryInfo> queryTree,
TreeNode<Set<String>> propertyTree)
Copies a tree of QueryInfo to a tree of Set
|
protected void |
ensureRequiredProperties(TreeNode<Set<String>> propertyTree,
boolean addIfEmpty)
Add required primary and foreign keys properties based on request type.
|
protected Schema |
getSchema(Resource.Type type)
Obtain a schema instance based on resource type.
|
void |
init(SchemaFactory schemaFactory)
Set a schema factory on the renderer.
|
protected boolean |
isRequestWithNoProperties(TreeNode<QueryInfo> queryNode)
Determine if the query node contains no properties and no children.
|
protected void |
populateSubResourceDefaults(SubResourceDefinition subResource,
Set<String> properties)
Populate sub-resource properties.
|
boolean |
requiresPropertyProviderInput()
Obtains the property provider requirements of the given
renderer implementation.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
finalizeProperties, finalizeResult, getResultPostProcessor
public void init(SchemaFactory schemaFactory)
Renderer
public boolean requiresPropertyProviderInput()
Renderer
requiresPropertyProviderInput
in interface Renderer
protected Schema getSchema(Resource.Type type)
type
- resource typeprotected void copyPropertiesToResult(TreeNode<QueryInfo> queryTree, TreeNode<Set<String>> propertyTree)
Renderer.finalizeProperties(TreeNode, boolean)
for converting
the passed in tree of query info to the return type which is a set of property names.queryTree
- source treepropertyTree
- target treeprotected void addPrimaryKey(Resource.Type resourceType, Set<String> properties)
resourceType
- resource typeproperties
- set of properties which pk will be added toprotected void addKeys(Resource.Type resourceType, Set<String> properties)
resourceType
- resource typeproperties
- set of properties which keys will be added toprotected boolean isRequestWithNoProperties(TreeNode<QueryInfo> queryNode)
queryNode
- the query node to checkprotected void addSubResources(TreeNode<QueryInfo> queryTree, TreeNode<Set<String>> propertyTree)
queryTree
- query treepropertyTree
- property treeprotected void populateSubResourceDefaults(SubResourceDefinition subResource, Set<String> properties)
subResource
- definition of sub-resourceproperties
- property set to updateprotected void ensureRequiredProperties(TreeNode<Set<String>> propertyTree, boolean addIfEmpty)
propertyTree
- tree of propertiesaddIfEmpty
- whether keys should be added to node with no propertiesCopyright © 2022 Apache Software Foundation. All rights reserved.