Package repast.simphony.integration
Class BeanQueryer
java.lang.Object
repast.simphony.integration.BeanQueryer
- All Implemented Interfaces:
- Queryable
A queryable that works on Beans using JXPath. This uses the
 
JXPathUtils class to perform the querying, so more
 information can be found there.- Author:
- Jerry Vos
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionBeanQueryer(Object rootObj) Creates the queryer with the specified object as the root.
- 
Method SummaryModifier and TypeMethodDescriptiongetRoot()Returns the root object for this queryer.Just returns the passed in object since JXPath doesn't have a concept of nodes.selectNode(Object curContext, String path) This will create a JXPathContext for the curContext if the curContext Object is not a JXPathContext and will pass that created context in toJXPathUtils.getXPathNode(JXPathContext, JXPathContext, String).selectNode(String path) Returns the value ofJXPathUtils.getXPathNode(rootContext, null, path)}.List<?>selectNodes(Object curContext, String path) Returns a collection of nodes according toJXPathUtils.getXPathNodes(JXPathContext, JXPathContext, String).List<?>selectNodes(String path) Returns a collection of nodes according toJXPathUtils.getXPathNodes(JXPathContext, JXPathContext, String).
- 
Constructor Details- 
BeanQueryerCreates the queryer with the specified object as the root. Note this gets wrapped in a FileDef object, so getRoot() returns a FileDef object that returns the passed in rootObj in it's FileDef method.- Parameters:
- rootObj- the root object
 
 
- 
- 
Method Details- 
selectNodeReturns the value ofJXPathUtils.getXPathNode(rootContext, null, path)}.- Specified by:
- selectNodein interface- Queryable
- Parameters:
- path- the XPath string to evaluate
- Returns:
- either an Object or null
- See Also:
 
- 
selectNodeThis will create a JXPathContext for the curContext if the curContext Object is not a JXPathContext and will pass that created context in toJXPathUtils.getXPathNode(JXPathContext, JXPathContext, String).- Specified by:
- selectNodein interface- Queryable
- Parameters:
- curContext- the current context for evaluation
- path- the XPath string to evaluate
- Returns:
- an object or null.
- See Also:
 
- 
selectNodesReturns a collection of nodes according toJXPathUtils.getXPathNodes(JXPathContext, JXPathContext, String).- Specified by:
- selectNodesin interface- Queryable
- Parameters:
- path- the XPath string to evaluate
- Returns:
- a non-null collection of nodes
 
- 
selectNodesReturns a collection of nodes according toJXPathUtils.getXPathNodes(JXPathContext, JXPathContext, String). If curContext is not a JXPathContext then this will create one for it and pass it in as the current context to the JXPathUtils method.- Specified by:
- selectNodesin interface- Queryable
- Parameters:
- curContext- the current context for evaluation
- path- the XPath string to evaluate
- Returns:
- a non-null collection of nodes
 
- 
getRootReturns the root object for this queryer. This will not be the object passed into the constructor, but will be a FileDef object wrapping that object.
- 
getValueJust returns the passed in object since JXPath doesn't have a concept of nodes.
 
-