public class SelectionCollector extends Object implements Selection
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
onlyDeclaredProperties
Whether to collect only declared properties for
a type, otherwise indicates to collect all properties
for a given type and all its base types
|
protected boolean |
onlySingularProperties
Whether to collect only singular reference
properties and follow paths composed of only
singular properties.
|
protected Type |
rootType |
| Constructor and Description |
|---|
SelectionCollector(Select select,
Type rootType) |
SelectionCollector(Select select,
Type rootType,
boolean onlySingularProperties) |
SelectionCollector(Select select,
Where where,
OrderBy orderBy,
Type rootType) |
SelectionCollector(Select select,
Where where,
OrderBy orderBy,
Type rootType,
boolean onlySingularProperties) |
SelectionCollector(Select select,
Where where,
Type rootType) |
SelectionCollector(Select select,
Where where,
Type rootType,
boolean onlySingularProperties) |
SelectionCollector(Where where,
Type rootType) |
SelectionCollector(Where where,
Type rootType,
boolean onlySingularProperties) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addInheritedProperty(Type type,
Integer level,
Property property,
Map<Type,Map<Integer,Set<Property>>> map) |
protected void |
addInheritedProperty(Type type,
Property property,
Map<Type,Set<Property>> map) |
protected void |
addInheritedProperty(Type type,
Property edge,
Property property,
Map<Type,Map<Property,Set<Property>>> map) |
protected void |
addPredicate(Property property,
Integer level,
Where predicate,
Map<Property,Map<Integer,Where>> map) |
protected void |
addPredicate(Property property,
Property edge,
Where predicate,
Map<Property,Map<Property,Where>> map) |
protected void |
addProperty(Type type,
Integer level,
Property property,
Map<Type,Map<Integer,Set<Property>>> map) |
protected void |
addProperty(Type type,
Property property,
Map<Type,Set<Property>> map) |
protected void |
addProperty(Type type,
Property edge,
Property property,
Map<Type,Map<Property,Set<Property>>> map) |
List<Type> |
addProperty(Type rootType,
String path)
Adds the given given property to the
selection for the given graph root type and
returns any types collected during traversal
of the property path.
|
String |
dumpInheritedProperties() |
String |
dumpProperties() |
protected Property[] |
findProperties(Type type,
AbstractProperty abstractProperty)
A convenience method returning an array of names for
the given property whether a wildcard
property or not.
|
protected String[] |
findPropertyNames(Type type,
AbstractProperty abstractProperty)
A convenience method returning an array of names for
the given property whether a wildcard
property or not.
|
List<Function> |
getFunctions(Property property)
Returns the functions for the given property or empty list
if the given property has no functions.
|
List<Function> |
getFunctions(Property property,
int level)
Returns the functions for the given property for the given
traversal level or graph depth, or empty list
if the given property has no functions.
|
Set<Property> |
getInheritedProperties(Type type)
Returns the unique set of inherited data and reference
properties collected for the given type, and any base types
of the given type, irrespective
of the (query) graph level.
|
Set<Property> |
getInheritedProperties(Type type,
int level)
Returns the unique set of inherited data and reference
properties collected for the given type, and any base types
of the given type, for the given
(query) graph level.
|
Set<Property> |
getInheritedProperties(Type type,
Property sourceProperty)
Returns the unique set of inherited data and reference
properties collected for the given Type for the given
(query) graph edge source property.
|
Set<Property> |
getInheritedProperties(Type type,
Property sourceProperty,
int level)
Returns the unique set of inherited data and reference
properties collected for the given Type for the given
(query) graph edge source property at the given traversal
level or graph depth.
|
List<Type> |
getInheritedTypes()
Returns all selected types and as well as types
which specialize or inherit from the selected types.
|
Where |
getPredicate(Property property)
Returns the predicate for the given property or null
if the given property has no predicates.
|
Where |
getPredicate(Property property,
int level)
Returns the predicate , if exists, collected for the given property for the given
traversal level or graph depth.
|
Where |
getPredicate(Property property,
Property sourceProperty)
Returns the predicate, if exists, collected for the given property and for the given
(query) graph edge source property.
|
Map<Property,Where> |
getPredicateMap()
Deprecated.
|
Set<Property> |
getProperties(Type type)
Returns the unique set of data and reference
properties collected for the given type irrespective
of the (query) graph level, or source graph edge type.
|
Set<Property> |
getProperties(Type type,
int level)
Returns the unique set of data and reference
properties collected for the given Type for the given
(query) graph level.
|
Set<Property> |
getProperties(Type type,
Property sourceProperty)
Returns the unique set of data and reference
properties collected for the given Type for the given
(query) graph edge source property.
|
Set<Property> |
getProperties(Type type,
Property sourceProperty,
int level)
Returns the unique set of data and reference
properties collected for the given Type for the given
(query) graph edge source property at the given traversal
level or graph depth.
|
Set<Property> |
getSingularProperties(Type type)
Returns the unique set of singular data and reference
properties collected for the given type irrespective
of the (query) graph level, or source graph edge type.
|
List<Type> |
getTypes()
Returns all selected types.
|
boolean |
hasInheritedProperty(Type type,
Property property)
Returns true if the given type is found in the inherited type selection and if the
given property is found in the property selection for the
given type.
|
boolean |
hasInheritedType(Type type)
Returns true if the given type is found in the
inherited type selection.
|
boolean |
hasPredicates()
(non-Javadoc)
|
boolean |
hasProperty(Type type,
Property property)
Returns true if the given type is found in the type selection and if the
given property is found in the property selection for the
given type.
|
boolean |
hasType(Type type)
Returns true if the given type is found in the
type selection.
|
boolean |
isOnlyDeclaredProperties()
Returns whether to collect only declared properties for
a type.
|
boolean |
isOnlySingularProperties()
Returns whether to collect only singular properties and
follow paths composed of only singular properties.
|
protected boolean |
isSingularPath(Path path,
Type currType,
AbstractPathElement currPathElement,
int curPathElementIndex,
AbstractProperty abstractProperty)
Recursively traverses the given path checking every
path element and determines if the entire path is composed of
singular properties.
|
protected boolean |
isSingularPath(Path path,
Type rootType,
AbstractProperty abstractProperty)
Recursively traverses the given path checking every
path element and determines if the entire path is composed of
singular properties.
|
protected void |
mapFunctions(Property prop,
Integer level,
List<Function> functions,
Map<Property,Map<Integer,List<Function>>> map) |
protected void |
mapFunctions(Property prop,
List<Function> functions,
Map<Property,List<Function>> map) |
protected void |
mapInheritedProperties(Type type,
Integer level,
Property[] props,
Map<Type,Map<Integer,Set<Property>>> map) |
protected void |
mapInheritedProperties(Type type,
Property[] props,
Map<Type,Set<Property>> map) |
protected void |
mapInheritedProperties(Type type,
Property edge,
Property[] props,
Map<Type,Map<Property,Set<Property>>> map) |
protected void |
mapInheritedProperty(Type type,
Property property,
Map<Type,List<String>> map) |
protected void |
mapInheritedPropertyNames(Type type,
String[] names,
Map<Type,List<String>> map) |
protected void |
mapProperties(Type type,
Integer level,
Property[] props,
Map<Type,Map<Integer,Set<Property>>> map) |
protected void |
mapProperties(Type type,
Property[] props,
Map<Type,Set<Property>> map) |
protected void |
mapProperties(Type type,
Property edge,
Property[] props,
Map<Type,Map<Property,Set<Property>>> map) |
protected void |
mapProperty(Type type,
Property property,
Map<Type,List<String>> map) |
protected void |
mapPropertyNames(Type type,
String[] names,
Map<Type,List<String>> map) |
void |
setOnlyDeclaredProperties(boolean onlyDeclaredProperties)
Sets whether to collect only declared properties for
a type.
|
void |
setOnlySingularProperties(boolean onlySingularProperties)
Sets whether to collect only singular properties and
follow paths composed of only singular properties.
|
protected Type rootType
protected boolean onlySingularProperties
protected boolean onlyDeclaredProperties
public SelectionCollector(Select select, Type rootType, boolean onlySingularProperties)
public SelectionCollector(Select select, Where where, Type rootType, boolean onlySingularProperties)
public SelectionCollector(Select select, Where where, OrderBy orderBy, Type rootType)
public SelectionCollector(Select select, Where where, OrderBy orderBy, Type rootType, boolean onlySingularProperties)
@Deprecated public Map<Property,Where> getPredicateMap()
public boolean hasPredicates()
hasPredicates in interface Selectionpublic Where getPredicate(Property property)
SelectiongetPredicate in interface Selectionproperty - the propertypublic Set<Property> getSingularProperties(Type type)
SelectiongetSingularProperties in interface Selectiontype - the typepublic Set<Property> getProperties(Type type)
SelectiongetProperties in interface Selectiontype - the typepublic Set<Property> getInheritedProperties(Type type)
SelectiongetInheritedProperties in interface Selectiontype - the typepublic Set<Property> getInheritedProperties(Type type, Property sourceProperty)
SelectiongetInheritedProperties in interface Selectiontype - the type (query) graph edge source propertysourceProperty - thepublic Set<Property> getInheritedProperties(Type type, int level)
SelectiongetInheritedProperties in interface Selectiontype - the typelevel - the specific graph level where the properties were specified in the selectionpublic Set<Property> getInheritedProperties(Type type, Property sourceProperty, int level)
SelectiongetInheritedProperties in interface Selectiontype - the type (query) graph edge source propertysourceProperty - thelevel - the traversal level or graph depthpublic List<Type> getTypes()
Selectionpublic boolean hasType(Type type)
Selectionpublic List<Type> getInheritedTypes()
SelectiongetInheritedTypes in interface Selectionpublic boolean hasInheritedType(Type type)
SelectionhasInheritedType in interface Selectiontype - the typepublic boolean hasProperty(Type type, Property property)
SelectionhasProperty in interface Selectiontype - the typeproperty - the propertypublic List<Type> addProperty(Type rootType, String path)
SelectionaddProperty in interface SelectionrootType - the graph root typepath - the SDO XPath specifying a path from the given root type
to a target or endpoint propertypublic boolean hasInheritedProperty(Type type, Property property)
SelectionhasInheritedProperty in interface Selectiontype - the typeproperty - the propertypublic Set<Property> getProperties(Type type, int level)
SelectiongetProperties in interface Selectiontype - the typelevel - the specific graph level where the properties were specified in the selectionpublic Set<Property> getProperties(Type type, Property sourceProperty)
SelectiongetProperties in interface Selectiontype - the type (query) graph edge source propertysourceProperty - the (query) graph edge source propertypublic Set<Property> getProperties(Type type, Property sourceProperty, int level)
SelectiongetProperties in interface Selectiontype - the type (query) graph edge source propertysourceProperty - the (query) graph edge source propertylevel - the traversal level or graph depthpublic Where getPredicate(Property property, Property sourceProperty)
SelectiongetPredicate in interface Selectionproperty - the source propertysourceProperty - the (query) graph edge source propertypublic Where getPredicate(Property property, int level)
SelectiongetPredicate in interface Selectionlevel - the traversal level or graph depthpublic List<Function> getFunctions(Property property)
SelectiongetFunctions in interface Selectionproperty - the propertypublic List<Function> getFunctions(Property property, int level)
SelectiongetFunctions in interface Selectionproperty - the propertylevel - the traversal level or graph depthpublic String dumpProperties()
public String dumpInheritedProperties()
public boolean isOnlySingularProperties()
public void setOnlySingularProperties(boolean onlySingularProperties)
public boolean isOnlyDeclaredProperties()
public void setOnlyDeclaredProperties(boolean onlyDeclaredProperties)
protected void addProperty(Type type, Integer level, Property property, Map<Type,Map<Integer,Set<Property>>> map)
protected void addPredicate(Property property, Integer level, Where predicate, Map<Property,Map<Integer,Where>> map)
protected void addProperty(Type type, Property edge, Property property, Map<Type,Map<Property,Set<Property>>> map)
protected void addPredicate(Property property, Property edge, Where predicate, Map<Property,Map<Property,Where>> map)
protected void mapInheritedProperty(Type type, Property property, Map<Type,List<String>> map)
protected void addInheritedProperty(Type type, Property property, Map<Type,Set<Property>> map)
protected void addInheritedProperty(Type type, Integer level, Property property, Map<Type,Map<Integer,Set<Property>>> map)
protected void addInheritedProperty(Type type, Property edge, Property property, Map<Type,Map<Property,Set<Property>>> map)
protected void mapPropertyNames(Type type, String[] names, Map<Type,List<String>> map)
protected void mapProperties(Type type, Property[] props, Map<Type,Set<Property>> map)
protected void mapFunctions(Property prop, List<Function> functions, Map<Property,List<Function>> map)
protected void mapProperties(Type type, Integer level, Property[] props, Map<Type,Map<Integer,Set<Property>>> map)
protected void mapFunctions(Property prop, Integer level, List<Function> functions, Map<Property,Map<Integer,List<Function>>> map)
protected void mapProperties(Type type, Property edge, Property[] props, Map<Type,Map<Property,Set<Property>>> map)
protected void mapInheritedPropertyNames(Type type, String[] names, Map<Type,List<String>> map)
protected void mapInheritedProperties(Type type, Property[] props, Map<Type,Set<Property>> map)
protected void mapInheritedProperties(Type type, Integer level, Property[] props, Map<Type,Map<Integer,Set<Property>>> map)
protected void mapInheritedProperties(Type type, Property edge, Property[] props, Map<Type,Map<Property,Set<Property>>> map)
protected String[] findPropertyNames(Type type, AbstractProperty abstractProperty)
type - the typeabstractProperty - the propertyprotected Property[] findProperties(Type type, AbstractProperty abstractProperty)
type - the typeabstractProperty - the propertyprotected boolean isSingularPath(Path path, Type rootType, AbstractProperty abstractProperty)
path - the pathrootType - the root typeabstractProperty - protected boolean isSingularPath(Path path, Type currType, AbstractPathElement currPathElement, int curPathElementIndex, AbstractProperty abstractProperty)
path - the pathcurrType - the current typecurrPathElement - the current path elementcurPathElementIndex - the current path element indexabstractProperty - the propertyCopyright © 2017. All rights reserved.