|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecteu.xtreemos.xosd.factory.utils.parsers.XMLSearchEngine
public class XMLSearchEngine
Search engine for the output of the XMLValidatorAndParser
XMLValidatorAndParser
Field Summary | |
---|---|
private java.util.Hashtable<java.lang.String,java.lang.Object> |
data
|
(package private) static org.apache.log4j.Logger |
logger
|
Constructor Summary | |
---|---|
XMLSearchEngine(java.util.Hashtable<java.lang.String,java.lang.Object> data)
Constructor for XMLSearchEngine class |
Method Summary | |
---|---|
java.util.ArrayList |
get(java.lang.String key)
Returns an ArrayList object of the XML subtrees whose keys match the provided key. |
private java.util.ArrayList |
get(java.lang.String key,
java.util.Hashtable<java.lang.String,java.lang.Object> inData)
Returns an ArrayList object of the XML subtrees whose keys match the provided key. |
java.util.ArrayList |
get(java.lang.String key,
java.lang.String whereKey,
java.lang.String whereValue)
Returns an ArrayList object of the XML subtrees whose keys first match the key and then in a subtree there must exist another key (whereKey) which value must equeal to the provided value (whereValue) This method is simple equivalent of the SELECT ... |
java.util.ArrayList |
getFirst(java.lang.String key)
This is counterpart of all XMLSearchEngine.get*First methods which are used to search just on level one of the XML tree. |
private java.util.ArrayList |
getFirst(java.lang.String key,
java.util.Hashtable<java.lang.String,java.lang.Object> inData)
This is copy of the upper get method. |
private java.util.ArrayList |
getWhere(java.lang.String key,
java.lang.String whereKey,
java.lang.String whereValue,
java.util.Hashtable<java.lang.String,java.lang.Object> inData)
Returns an ArrayList object of the XML subtrees whose keys first match the key and then in a subtree there must exist another key (whereKey) which value must equeal to the provided value (whereValue) This method is simple equivalent of the SELECT ... |
java.util.ArrayList |
getXPath(java.lang.String key,
java.util.Hashtable<java.lang.String,java.lang.Object> inData)
Returns an ArrayList object of the XML subtrees whose keys match the provided keyPath (XPath style). |
java.util.ArrayList |
getXPathFirst(java.lang.String key,
java.util.Hashtable<java.lang.String,java.lang.Object> inData)
This is basically the same implementation as getXPath method but it searches just in depth of level 1 (does not search in depth). |
private boolean |
hashtableContainsKey(java.lang.String regexKey,
java.util.Hashtable<java.lang.String,java.lang.Object> hash)
The method checks whether there is any key in the Hashtable matching the regexKey regular expression. |
private java.util.ArrayList |
hashtableGetValue(java.lang.String regexKey,
java.util.Hashtable<java.lang.String,java.lang.Object> hash)
The method gets an ArrayList corresponding to the matches via regular expression. |
private boolean |
keyHasValue(java.lang.String key,
java.lang.String value,
java.lang.Object inData)
Finds the key in the inData structure and checks whether its value matches the provided value. |
static void |
main(java.lang.String[] args)
Main method - used for testing |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.Hashtable<java.lang.String,java.lang.Object> data
static org.apache.log4j.Logger logger
Constructor Detail |
---|
public XMLSearchEngine(java.util.Hashtable<java.lang.String,java.lang.Object> data)
data
- The data provided with XMLValidatorAndParser.XMLValidatorAndParser
Method Detail |
---|
private boolean hashtableContainsKey(java.lang.String regexKey, java.util.Hashtable<java.lang.String,java.lang.Object> hash)
regexKey
- the regular expression with which the keys should be comparedhash
- the hashtable with keys to compare
expressions: http://java.sun.com/javase/6/docs/api/java/util/regex/Pattern.html#sum
private java.util.ArrayList hashtableGetValue(java.lang.String regexKey, java.util.Hashtable<java.lang.String,java.lang.Object> hash)
regexKey
- the regular expression with which the keys should be comparedhash
- the hashtable with keys to compare
expressions: http://java.sun.com/javase/6/docs/api/java/util/regex/Pattern.html#sum
private java.util.ArrayList get(java.lang.String key, java.util.Hashtable<java.lang.String,java.lang.Object> inData)
The subtrees are Hashtables mixed with ArrayLists. Hashtable is of type XML tag/XML value, where XML value can be another Hashtable or in case of multiple descendants (defined as sequence) an ArrayList.
If no value is found, an empty ArrayList is returned.
key
- The name of the XML tag to look for.
get(String key, String whereKey, String whereValue)
private java.util.ArrayList getFirst(java.lang.String key, java.util.Hashtable<java.lang.String,java.lang.Object> inData)
key
- inData
- level
-
private boolean keyHasValue(java.lang.String key, java.lang.String value, java.lang.Object inData)
key
- The name of the key to look for.value
- The value that must match the one found with the key.
private java.util.ArrayList getWhere(java.lang.String key, java.lang.String whereKey, java.lang.String whereValue, java.util.Hashtable<java.lang.String,java.lang.Object> inData)
This method is simple equivalent of the SELECT ... WHERE ... statement in SQL.
The subtrees are Hashtables mixed with ArrayLists. Hashtable is of type XML tag/XML value, where XML value can be another Hashtable or in case of multiple descendants (defined as sequence) an ArrayList.
If no value is found, an empty ArrayList is returned.
key
- The name of the XML tag to look for.whereKey
- The name of the XML tag in the subtree to look for.whereValue
- The value that must match the subtree key.
get(String key, String whereKey, String whereValue)
public java.util.ArrayList getXPath(java.lang.String key, java.util.Hashtable<java.lang.String,java.lang.Object> inData)
The subtrees are Hashtables mixed with ArrayLists. Hashtable is of type XML tag/XML value, where XML value can be another Hashtable or in case of multiple descendants (defined as sequence) an ArrayList.
If no value is found, an empty ArrayList is returned.
key
- The name of the XML tag to look for.
get(String key, String whereKey, String whereValue)
public java.util.ArrayList getXPathFirst(java.lang.String key, java.util.Hashtable<java.lang.String,java.lang.Object> inData)
This method can be used to search for tags and its context which are nested (as complex types).
key
- What label to look forinData
-
public java.util.ArrayList get(java.lang.String key)
The subtrees are Hashtables mixed with ArrayLists. Hashtable is of type XML tag/XML value, where XML value can be another Hashtable or in case of multiple descendants (defined as sequence) an ArrayList.
If no value is found, an empty ArrayList is returned.
key
- The name of the XML tag to look for.
get(String key, String whereKey, String whereValue)
public java.util.ArrayList getFirst(java.lang.String key)
key
-
public java.util.ArrayList get(java.lang.String key, java.lang.String whereKey, java.lang.String whereValue)
This method is simple equivalent of the SELECT ... WHERE ... statement in SQL.
The subtrees are Hashtables mixed with ArrayLists. Hashtable is of type XML tag/XML value, where XML value can be another Hashtable or in case of multiple descendants (defined as sequence) an ArrayList.
If no value is found, an empty ArrayList is returned.
key
- The name of the XML tag to look for.whereKey
- The name of the XML tag in the subtree to look for.whereValue
- The value that must match the subtree key.
get(String key)
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |