|
Humboldt Alignment Editor 2.5.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecteu.esdihumboldt.hale.common.instance.helper.PropertyResolver
public class PropertyResolver
This class provides plubic static methods for resolving propertys from instances. A cache provides that former accessed propertys are found faster and the programm does not need to search over the whole definitiontree of the instances again. Note: stringquery or querypath in comments references to a path of indicies reassambling a path of definitions inside the instance-definition-tree
Constructor Summary | |
---|---|
PropertyResolver()
|
Method Summary | |
---|---|
static void |
clearCache()
Clear the definition cache, e.g. |
static LinkedList<String> |
getKnownQueryPath(Instance instance,
String query)
Gets a certain definitionpath from the Cache by generating the cacheindex object from a given Instance (its Definitions) and the pathquery |
static List<QName> |
getQNamesFromPath(String propertyPath)
Split a property path into a list of QName s. |
static Collection<Object> |
getValues(Instance instance,
String propertyPath)
Method for retrieving values from instances using a certain path query for searching through the instance definitions. |
static Collection<Object> |
getValues(Instance instance,
String propertyPath,
boolean forceValue)
Method for retrieving values from instances using a certain path query for searching through the instance definitions. |
static boolean |
hasProperty(Instance instance,
String query)
Determines of the given Instance contains certain definitions questioned by a given stringquery. |
static boolean |
isLastQueryPathUnique()
Determines if the last query path was unique. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PropertyResolver()
Method Detail |
---|
public static Collection<Object> getValues(Instance instance, String propertyPath)
instance
- the instancepropertyPath
- the property path
public static Collection<Object> getValues(Instance instance, String propertyPath, boolean forceValue)
instance
- the instancepropertyPath
- the property pathforceValue
- if this is true
, when the object at the
end of a path is an instance, its value will be returned
null
public static List<QName> getQNamesFromPath(String propertyPath)
QName
s.
propertyPath
- the property path
public static boolean hasProperty(Instance instance, String query)
instance
- the given instance we are searching inquery
- the given pathquery we are searching inside the
definition-tree
public static LinkedList<String> getKnownQueryPath(Instance instance, String query)
instance
- the given instance wich should contain the definitions
mentioned in the pathsquery
- the pathstring from the filterquery
public static boolean isLastQueryPathUnique()
hasProperty(Instance, String)
was done from the current thread.
The information on the last hasProperty(Instance, String)
call
will be reset on calling this method.
true
if the last query path was unique or if there
is no information on the last query path, false
otherwisepublic static void clearCache()
|
Humboldt Alignment Editor 2.5.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |