|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.limegroup.gnutella.xml.LimeXMLDocument
Field Summary | |
static java.lang.String |
XML_HEADER
|
static java.lang.String |
XML_ID_ATTRIBUTE_STRING
|
Constructor Summary | |
LimeXMLDocument(java.util.Collection nameValueList,
java.lang.String schemaURI)
Constructs a new LimeXMLDocument |
|
LimeXMLDocument(org.w3c.dom.Node node,
org.w3c.dom.Node rootElement)
|
|
LimeXMLDocument(java.lang.String XMLStr)
|
Method Summary | |
static java.lang.String |
constructXML(java.util.List namValList,
java.lang.String uri)
finds the structure of the document by looking at the names of the keys in the NameValue List and creates an XML string. |
boolean |
equals(java.lang.Object o)
Overrides equals to check for equality of all xml document fields. |
java.lang.String |
getAction()
|
java.lang.String |
getIdentifier()
Returns the name of the file that the data in this XML document corresponds to. |
java.util.List |
getKeyWords()
Returns all the non-numeric fields in this. |
java.util.Set |
getNameValueSet()
Returns a Set of Map.Entry, where each key-value corresponds to a Canonicalized field name (placeholder), and its corresponding value in the XML Document. |
int |
getNumFields()
|
java.util.List |
getOrderedNameValueList()
This method is only guaranteed to work if getSchemaURI() returns a non-null value. |
java.lang.String |
getSchemaURI()
Returns the unique identifier which identifies the schema this XML document conforms to |
java.lang.String |
getValue(java.lang.String fieldName)
|
java.util.Collection |
getValueList()
Returns a collection of the values of this LimeXMLDocument. |
java.lang.String |
getXMLString()
|
java.lang.String |
getXMLStringWithIdentifier()
|
int |
hashCode()
Overrides Object.hashCode to satisfy the contract for hashCode, given that we're overriding equals. |
void |
setIdentifier(java.lang.String id)
|
void |
setSchemaURI(java.lang.String uri)
This method is used by Lime Peer Server |
java.lang.String |
toString()
Returns the XML identifier for the string. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String XML_ID_ATTRIBUTE_STRING
public static final java.lang.String XML_HEADER
Constructor Detail |
public LimeXMLDocument(java.lang.String XMLStr) throws org.xml.sax.SAXException, SchemaNotFoundException, java.io.IOException
public LimeXMLDocument(org.w3c.dom.Node node, org.w3c.dom.Node rootElement) throws SchemaNotFoundException, java.io.IOException
public LimeXMLDocument(java.util.Collection nameValueList, java.lang.String schemaURI)
nameValueList
- List (of NameValue) of fieldnames (in canonicalized
form) and corresponding values that will be used to create the
new instanceschemaURI
- The schema URI for the LimeXMLDocument to be
createdMethod Detail |
public void setIdentifier(java.lang.String id)
public void setSchemaURI(java.lang.String uri)
public int getNumFields()
public java.util.List getKeyWords()
public java.lang.String getSchemaURI()
public java.lang.String getIdentifier()
public java.lang.String getAction()
public java.util.Set getNameValueSet()
Canonicalization:
So as to preserve the structure, Structure.Field will be represented as Structure__Field (Double Underscore is being used as a delimiter to represent the structure).
In case of multiple structured values with same name, as might occur while using + or * in the regular expressions in schema, those should be represented as using the array index using the __ notation (withouth the square brackets) for e.g. myarray[0].name ==> myarray__0__name attribute names for an element in the XML schema should be postfixed with __ (double underscore). So element.attribute ==> element__attribute__
public java.util.Collection getValueList()
public java.util.List getOrderedNameValueList() throws SchemaNotFoundException
SchemaNotFoundException
- Thrown if you called this without
providing a valid XML schema. So please make sure your schema is ok.public java.lang.String getValue(java.lang.String fieldName)
public java.lang.String getXMLString() throws SchemaNotFoundException
SchemaNotFoundException
- DO NOT CALL THIS METHOD unless
you know that getSchemaURI() returns a valid xml schema. Set it
yourself with setSchemaURI().public java.lang.String getXMLStringWithIdentifier() throws SchemaNotFoundException
SchemaNotFoundException
- DO NOT CALL THIS METHOD unless
you know that getSchemaURI() returns a valid xml schema. Set it
yourself with setSchemaURI().public static java.lang.String constructXML(java.util.List namValList, java.lang.String uri)
The name value list must have the correct ordering.
The values are converted into the correect encoding as per the XML specifications. So the caller of this method need not pre-encode the special XML characters into the values.
public boolean equals(java.lang.Object o)
o
- the object to compare
public int hashCode()
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |