|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.plasma.query.collector.SelectionCollector
public class SelectionCollector
Traverses a given Select) clause collecting the specified property names, as well as any path-reference or key properties required for graph structure, into a simple list of logical property name strings mapped to the respective {@link Type} definition.
Select,
Type| Field Summary | |
|---|---|
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 Summary | |
|---|---|
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)
|
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Type rootType
protected boolean onlySingularProperties
protected boolean onlyDeclaredProperties
| Constructor Detail |
|---|
public SelectionCollector(Select select,
Type rootType)
public SelectionCollector(Select select,
Type rootType,
boolean onlySingularProperties)
public SelectionCollector(Select select,
Where where,
Type rootType)
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)
public SelectionCollector(Where where,
Type rootType)
public SelectionCollector(Where where,
Type rootType,
boolean onlySingularProperties)
| Method Detail |
|---|
@Deprecated public Map<Property,Where> getPredicateMap()
public boolean hasPredicates()
hasPredicates in interface Selectionpublic Where getPredicate(Property property)
Selection
getPredicate in interface Selectionproperty - the property
public Set<Property> getSingularProperties(Type type)
Selection
getSingularProperties in interface Selectiontype - the type
public Set<Property> getProperties(Type type)
Selection
getProperties in interface Selectiontype - the type
public Set<Property> getInheritedProperties(Type type)
Selection
getInheritedProperties in interface Selectiontype - the type
public Set<Property> getInheritedProperties(Type type,
Property sourceProperty)
Selection
getInheritedProperties in interface Selectiontype - the type (query) graph edge source propertysourceProperty - the
public Set<Property> getInheritedProperties(Type type,
int level)
Selection
getInheritedProperties in interface Selectiontype - the typelevel - the specific graph level where the properties were specified in the selection
public Set<Property> getInheritedProperties(Type type,
Property sourceProperty,
int level)
Selection
getInheritedProperties in interface Selectiontype - the type (query) graph edge source propertysourceProperty - thelevel - the traversal level or graph depth
public List<Type> getTypes()
Selection
getTypes in interface Selectionpublic boolean hasType(Type type)
Selection
hasType in interface Selectiontype - the type
public List<Type> getInheritedTypes()
Selection
getInheritedTypes in interface Selectionpublic boolean hasInheritedType(Type type)
Selection
hasInheritedType in interface Selectiontype - the type
public boolean hasProperty(Type type,
Property property)
Selection
hasProperty in interface Selectiontype - the typeproperty - the property
public List<Type> addProperty(Type rootType,
String path)
Selection
addProperty in interface SelectionrootType - the graph root typepath - the SDO XPath specifying a path from the given root type
to a target or endpoint property
public boolean hasInheritedProperty(Type type,
Property property)
Selection
hasInheritedProperty in interface Selectiontype - the typeproperty - the property
public Set<Property> getProperties(Type type,
int level)
Selection
getProperties in interface Selectiontype - the typelevel - the specific graph level where the properties were specified in the selection
public Set<Property> getProperties(Type type,
Property sourceProperty)
Selection
getProperties in interface Selectiontype - the type (query) graph edge source propertysourceProperty - the (query) graph edge source property
public Set<Property> getProperties(Type type,
Property sourceProperty,
int level)
Selection
getProperties in interface Selectiontype - the type (query) graph edge source propertysourceProperty - the (query) graph edge source propertylevel - the traversal level or graph depth
public Where getPredicate(Property property,
Property sourceProperty)
Selection
getPredicate in interface Selectionproperty - the source propertysourceProperty - the (query) graph edge source property
public Where getPredicate(Property property,
int level)
Selection
getPredicate in interface Selectionlevel - the traversal level or graph depth
public List<Function> getFunctions(Property property)
Selection
getFunctions in interface Selectionproperty - the property
public List<Function> getFunctions(Property property,
int level)
Selection
getFunctions in interface Selectionproperty - the propertylevel - the traversal level or graph depth
public String dumpProperties()
public String dumpInheritedProperties()
public boolean isOnlySingularProperties()
public void setOnlySingularProperties(boolean onlySingularProperties)
public boolean isOnlyDeclaredProperties()
public void setOnlyDeclaredProperties(boolean onlyDeclaredProperties)
protected void mapProperty(Type type,
Property property,
Map<Type,List<String>> map)
protected void addProperty(Type type,
Property property,
Map<Type,Set<Property>> map)
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 property
protected Property[] findProperties(Type type,
AbstractProperty abstractProperty)
type - the typeabstractProperty - the property
protected 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 property
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||