org.plasma.query.collector
Class PropertySelectionCollector

java.lang.Object
  extended by org.plasma.query.collector.PropertySelectionCollector
All Implemented Interfaces:
PropertySelection

Deprecated.

@Deprecated
public class PropertySelectionCollector
extends java.lang.Object
implements PropertySelection

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.

See Also:
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
PropertySelectionCollector(Select select, Type rootType)
          Deprecated.  
PropertySelectionCollector(Select select, Type rootType, boolean onlySingularProperties)
          Deprecated.  
 
Method Summary
protected  void addInheritedProperty(Type type, java.lang.Integer level, Property property, java.util.Map<Type,java.util.Map<java.lang.Integer,java.util.Set<Property>>> map)
           
protected  void addInheritedProperty(Type type, Property property, java.util.Map<Type,java.util.Set<Property>> map)
           
protected  void addInheritedProperty(Type type, Property edge, Property property, java.util.Map<Type,java.util.Map<Property,java.util.Set<Property>>> map)
           
protected  void addProperty(Type type, java.lang.Integer level, Property property, java.util.Map<Type,java.util.Map<java.lang.Integer,java.util.Set<Property>>> map)
           
protected  void addProperty(Type type, Property property, java.util.Map<Type,java.util.Set<Property>> map)
           
protected  void addProperty(Type type, Property edge, Property property, java.util.Map<Type,java.util.Map<Property,java.util.Set<Property>>> map)
           
 java.util.List<Type> addProperty(Type rootType, java.lang.String path)
          Deprecated. 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.
 void collect(Where predicate)
          Deprecated. Traverses the given predicate adding its properties and property paths to the selection.
 java.lang.String dumpInheritedProperties()
          Deprecated.  
 java.lang.String dumpProperties()
          Deprecated.  
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  java.lang.String[] findPropertyNames(Type type, AbstractProperty abstractProperty)
          A convenience method returning an array of names for the given property whether a wildcard property or not.
 java.util.List<java.lang.String> getInheritedProperties(Type type)
          Deprecated. Returns a list of data and reference property names collected specifically for the given type or collected for any base type of the given type.
 java.util.List<Type> getInheritedTypes()
          Deprecated. Returns all selected types and as well as types specialize or inherit from the selected types.
 Where getPredicate(Property property)
          Deprecated. Returns the predicate for the given property or null if the given property is not mapped.
 java.util.Map<Property,Where> getPredicateMap()
          Deprecated. 
 java.util.List<java.lang.String> getProperties(Type type)
          Deprecated. Returns a list of data and reference property names collected for the given type.
 java.util.Map<Type,java.util.List<java.lang.String>> getResult()
          Deprecated. 
 java.util.List<java.lang.String> getSingularProperties(Type type)
          Deprecated. Returns a list of only singular data and reference property names collected for the given type.
 java.util.Map<Type,java.util.List<java.lang.String>> getSingularPropertyMap()
          Deprecated. 
 java.util.List<Type> getTypes()
          Deprecated. Returns all selected types.
 boolean hasInheritedProperty(Type type, Property property)
          Deprecated. 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)
          Deprecated. Returns true if the given type is found in the inherited type selection.
 boolean hasProperty(Type type, Property property)
          Deprecated. 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)
          Deprecated. 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 mapInheritedProperties(Type type, java.lang.Integer level, Property[] props, java.util.Map<Type,java.util.Map<java.lang.Integer,java.util.Set<Property>>> map)
           
protected  void mapInheritedProperties(Type type, Property[] props, java.util.Map<Type,java.util.Set<Property>> map)
           
protected  void mapInheritedProperties(Type type, Property edge, Property[] props, java.util.Map<Type,java.util.Map<Property,java.util.Set<Property>>> map)
           
protected  void mapInheritedProperty(Type type, Property property, java.util.Map<Type,java.util.List<java.lang.String>> map)
           
protected  void mapInheritedPropertyNames(Type type, java.lang.String[] names, java.util.Map<Type,java.util.List<java.lang.String>> map)
           
protected  void mapProperties(Type type, java.lang.Integer level, Property[] props, java.util.Map<Type,java.util.Map<java.lang.Integer,java.util.Set<Property>>> map)
           
protected  void mapProperties(Type type, Property[] props, java.util.Map<Type,java.util.Set<Property>> map)
           
protected  void mapProperties(Type type, Property edge, Property[] props, java.util.Map<Type,java.util.Map<Property,java.util.Set<Property>>> map)
           
protected  void mapProperty(Type type, Property property, java.util.Map<Type,java.util.List<java.lang.String>> map)
           
protected  void mapPropertyNames(Type type, java.lang.String[] names, java.util.Map<Type,java.util.List<java.lang.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

rootType

protected Type rootType

onlySingularProperties

protected boolean onlySingularProperties
Whether to collect only singular reference properties and follow paths composed of only singular properties.


onlyDeclaredProperties

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

Constructor Detail

PropertySelectionCollector

public PropertySelectionCollector(Select select,
                                  Type rootType)
Deprecated. 

PropertySelectionCollector

public PropertySelectionCollector(Select select,
                                  Type rootType,
                                  boolean onlySingularProperties)
Deprecated. 
Method Detail

collect

public void collect(Where predicate)
Deprecated. 
Description copied from interface: PropertySelection
Traverses the given predicate adding its properties and property paths to the selection.

Specified by:
collect in interface PropertySelection
Parameters:
predicate - the predicate

getPredicateMap

@Deprecated
public java.util.Map<Property,Where> getPredicateMap()
Deprecated. 


getPredicate

public Where getPredicate(Property property)
Deprecated. 
Description copied from interface: PropertySelection
Returns the predicate for the given property or null if the given property is not mapped.

Specified by:
getPredicate in interface PropertySelection
Parameters:
property - the property
Returns:
the predicate for the given property or null if the given property is not mapped.

getSingularPropertyMap

@Deprecated
public java.util.Map<Type,java.util.List<java.lang.String>> getSingularPropertyMap()
Deprecated. 


getSingularProperties

public java.util.List<java.lang.String> getSingularProperties(Type type)
Deprecated. 
Description copied from interface: PropertySelection
Returns a list of only singular data and reference property names collected for the given type.

Specified by:
getSingularProperties in interface PropertySelection
Parameters:
type - the type
Returns:
a list of only singular data and reference property names collected for the given type.

getResult

@Deprecated
public java.util.Map<Type,java.util.List<java.lang.String>> getResult()
Deprecated. 

Return the specified property names, as well as any path-reference or key properties required for graph structure, as a simple list of logical property name strings mapped to the respective Type definition

Returns:
the Type to logical property name map

getProperties

public java.util.List<java.lang.String> getProperties(Type type)
Deprecated. 
Description copied from interface: PropertySelection
Returns a list of data and reference property names collected for the given type.

Specified by:
getProperties in interface PropertySelection
Parameters:
type - the type
Returns:
a list of data and reference property names collected for the given type.

getInheritedProperties

public java.util.List<java.lang.String> getInheritedProperties(Type type)
Deprecated. 
Description copied from interface: PropertySelection
Returns a list of data and reference property names collected specifically for the given type or collected for any base type of the given type.

Specified by:
getInheritedProperties in interface PropertySelection
Parameters:
type - the type
Returns:
a list of data and reference property names collected specifically for the given type or collected for any base type of the given type.

getTypes

public java.util.List<Type> getTypes()
Deprecated. 
Description copied from interface: PropertySelection
Returns all selected types.

Specified by:
getTypes in interface PropertySelection
Returns:
all selected types.

hasType

public boolean hasType(Type type)
Deprecated. 
Description copied from interface: PropertySelection
Returns true if the given type is found in the type selection.

Specified by:
hasType in interface PropertySelection
Parameters:
type - the type
Returns:
true if the given type is found in the type selection.

getInheritedTypes

public java.util.List<Type> getInheritedTypes()
Deprecated. 
Description copied from interface: PropertySelection
Returns all selected types and as well as types specialize or inherit from the selected types.

Specified by:
getInheritedTypes in interface PropertySelection
Returns:
all selected types and as well as types specialize or inherit from the selected types.

hasInheritedType

public boolean hasInheritedType(Type type)
Deprecated. 
Description copied from interface: PropertySelection
Returns true if the given type is found in the inherited type selection.

Specified by:
hasInheritedType in interface PropertySelection
Parameters:
type - the type
Returns:
true if the given type is found in the inherited type selection.

hasProperty

public boolean hasProperty(Type type,
                           Property property)
Deprecated. 
Description copied from interface: PropertySelection
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.

Specified by:
hasProperty in interface PropertySelection
Parameters:
type - the type
property - the 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.

addProperty

public java.util.List<Type> addProperty(Type rootType,
                                        java.lang.String path)
Deprecated. 
Description copied from interface: PropertySelection
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.

Specified by:
addProperty in interface PropertySelection
Parameters:
rootType - the graph root type
path - the SDO XPath specifying a path from the given root type to a target or endpoint property
Returns:
any types collected during traversal of the property path.

hasInheritedProperty

public boolean hasInheritedProperty(Type type,
                                    Property property)
Deprecated. 
Description copied from interface: PropertySelection
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.

Specified by:
hasInheritedProperty in interface PropertySelection
Parameters:
type - the type
property - the 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.

dumpProperties

public java.lang.String dumpProperties()
Deprecated. 

dumpInheritedProperties

public java.lang.String dumpInheritedProperties()
Deprecated. 

isOnlySingularProperties

public boolean isOnlySingularProperties()
Returns whether to collect only singular properties and follow paths composed of only singular properties.


setOnlySingularProperties

public void setOnlySingularProperties(boolean onlySingularProperties)
Sets whether to collect only singular properties and follow paths composed of only singular properties.


isOnlyDeclaredProperties

public boolean isOnlyDeclaredProperties()
Returns whether to collect only declared properties for a type.


setOnlyDeclaredProperties

public void setOnlyDeclaredProperties(boolean onlyDeclaredProperties)
Sets whether to collect only declared properties for a type.


mapProperty

protected void mapProperty(Type type,
                           Property property,
                           java.util.Map<Type,java.util.List<java.lang.String>> map)

addProperty

protected void addProperty(Type type,
                           Property property,
                           java.util.Map<Type,java.util.Set<Property>> map)

addProperty

protected void addProperty(Type type,
                           java.lang.Integer level,
                           Property property,
                           java.util.Map<Type,java.util.Map<java.lang.Integer,java.util.Set<Property>>> map)

addProperty

protected void addProperty(Type type,
                           Property edge,
                           Property property,
                           java.util.Map<Type,java.util.Map<Property,java.util.Set<Property>>> map)

mapInheritedProperty

protected void mapInheritedProperty(Type type,
                                    Property property,
                                    java.util.Map<Type,java.util.List<java.lang.String>> map)

addInheritedProperty

protected void addInheritedProperty(Type type,
                                    Property property,
                                    java.util.Map<Type,java.util.Set<Property>> map)

addInheritedProperty

protected void addInheritedProperty(Type type,
                                    java.lang.Integer level,
                                    Property property,
                                    java.util.Map<Type,java.util.Map<java.lang.Integer,java.util.Set<Property>>> map)

addInheritedProperty

protected void addInheritedProperty(Type type,
                                    Property edge,
                                    Property property,
                                    java.util.Map<Type,java.util.Map<Property,java.util.Set<Property>>> map)

mapPropertyNames

protected void mapPropertyNames(Type type,
                                java.lang.String[] names,
                                java.util.Map<Type,java.util.List<java.lang.String>> map)

mapProperties

protected void mapProperties(Type type,
                             Property[] props,
                             java.util.Map<Type,java.util.Set<Property>> map)

mapProperties

protected void mapProperties(Type type,
                             java.lang.Integer level,
                             Property[] props,
                             java.util.Map<Type,java.util.Map<java.lang.Integer,java.util.Set<Property>>> map)

mapProperties

protected void mapProperties(Type type,
                             Property edge,
                             Property[] props,
                             java.util.Map<Type,java.util.Map<Property,java.util.Set<Property>>> map)

mapInheritedPropertyNames

protected void mapInheritedPropertyNames(Type type,
                                         java.lang.String[] names,
                                         java.util.Map<Type,java.util.List<java.lang.String>> map)

mapInheritedProperties

protected void mapInheritedProperties(Type type,
                                      Property[] props,
                                      java.util.Map<Type,java.util.Set<Property>> map)

mapInheritedProperties

protected void mapInheritedProperties(Type type,
                                      java.lang.Integer level,
                                      Property[] props,
                                      java.util.Map<Type,java.util.Map<java.lang.Integer,java.util.Set<Property>>> map)

mapInheritedProperties

protected void mapInheritedProperties(Type type,
                                      Property edge,
                                      Property[] props,
                                      java.util.Map<Type,java.util.Map<Property,java.util.Set<Property>>> map)

findPropertyNames

protected java.lang.String[] findPropertyNames(Type type,
                                               AbstractProperty abstractProperty)
A convenience method returning an array of names for the given property whether a wildcard property or not. For wildcard properties determines the type of wildcard and returns the appropriate property set.

Parameters:
type - the type
abstractProperty - the property
Returns:
the property names as an array

findProperties

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. For wildcard properties determines the type of wildcard and returns the appropriate property set.

Parameters:
type - the type
abstractProperty - the property
Returns:
the property names as an array

isSingularPath

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.

Parameters:
path - the path
rootType - the root type
abstractProperty -
Returns:
whether the given path is composed entirely of singular \ properties

isSingularPath

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.

Parameters:
path - the path
currType - the current type
currPathElement - the current path element
curPathElementIndex - the current path element index
abstractProperty - the property
Returns:
whether the given path is composed entirely of singular \ properties


Copyright © 2013. All Rights Reserved.