|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gcube.indexmanagement.common.XMLProfileParser
public class XMLProfileParser
Provides various XML read only functions for the indexing service.
FullTextIndexType| Constructor Summary | |
|---|---|
XMLProfileParser()
Creates a parser instance. |
|
| Method Summary | |
|---|---|
int |
countDescendants(String elementName)
Counts the number of descendant elements with a specified element name |
static String |
escapeForXML(String text)
Inserts Entity References in the place of certain illegal characters in order to make an xml file valid |
String |
getFieldByValue(String elementName)
Gets the #text element of the specified element in the current field. |
String |
getFieldText(String fieldname)
Retreives the #text element of the first instance of fieldname. |
String[] |
getFieldTextArray(String fieldname)
Retreives the #text elements of all instances of fieldname. |
String[][] |
getSubFields()
Gets the (element name, #text value) pairs for all child nodes in the current field. |
boolean |
goChildElement(String elementName)
Sets the current node to the first child (of the current node) element with a specified element name |
boolean |
goParentElement(String elementName)
Sets the current node to the first ascendant (of the current node) element with a specified element name |
boolean |
goSiblingElement(String elementName)
Sets the current node to the first sibling (of the current node) element with a specified element name |
boolean |
hasDescendant(String elementName)
Determines whether the current node has one or more descendant elements with a specified element name |
boolean |
hasSibling(String elementName)
Determines whether the current node has one or more sibling elements with a specified element name |
void |
readDoc(String filename,
String schemaLocation)
Sets the current document to the parsed file. |
void |
readInputStream(InputStream is,
String schemaLocation)
Sets the current document to the parsed InputStream. |
void |
readString(String XMLString,
String schemaLocation)
Sets the current document to the parsed XML string. |
boolean |
setNextField()
Sets current node to next node. |
int |
setRootNode(String fieldname)
Sets the Field Node to the first child of the first instance of the field matching the argument. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XMLProfileParser()
| Method Detail |
|---|
public void readString(String XMLString,
String schemaLocation)
throws Exception
XMLString - - the XML document.schemaLocation - - The loactaion of the schema.
IndexException - - in case if failure
Exception
public void readDoc(String filename,
String schemaLocation)
throws Exception
filename - - the name of the file to parse.schemaLocation - - the location of the schema
Exception - - in case of failure.
public void readInputStream(InputStream is,
String schemaLocation)
throws Exception
is - - the input stream to parse.schemaLocation - - the location of the schema.
Exception - - in case of failure.
public String getFieldText(String fieldname)
throws Exception
fieldname.
fieldname - name of the element to retreive
Exception - - in case of failure.FullTextIndexType
public String[] getFieldTextArray(String fieldname)
throws Exception
fieldname.
fieldname - name of the element to retreive
Exception - - in case of failure.FullTextIndexType
public int setRootNode(String fieldname)
throws Exception
setNextField()
and getFieldByValue(String
elementName) will give 2nd
layerd text.
Exception - - in case of failure.public int countDescendants(String elementName)
elementName - String - the name of the elements to count
int - the number of descendants with the specified
elementName
public boolean setNextField()
throws Exception
Exception - - in case of failure.setRootNode(String fieldname)public boolean goChildElement(String elementName)
elementName - String - the name of the element to go to
boolean - true if the action was successfulpublic boolean goSiblingElement(String elementName)
elementName - String - the name of the element to go to
boolean - true if the action was successfulpublic boolean goParentElement(String elementName)
elementName - String - the name of the element to go to
boolean - true if the action was successfulpublic boolean hasDescendant(String elementName)
elementName - String - the element name to search for
boolean - true if one or more descendants were
foundpublic boolean hasSibling(String elementName)
elementName - String - the element name to search for
boolean - true if one or more siblings were found
public String getFieldByValue(String elementName)
throws Exception
elementName - element identifier
Exception - - in case of failure.setRootNode(String fieldname),
setNextField()
public String[][] getSubFields()
throws Exception
Exception - - in case of failure.setNextField(),
setRootNode(String fieldname)public static String escapeForXML(String text)
text - String - the xml file insert Entity References
into
String - a version of the xml file with Entity
References in the place of certain illegal characters
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||