|
S-PLUS Connect/Java v1.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.insightful.gdevice.XMLElement
XMLElement is a representation of an XML object. The object is able to parse XML code.
Note that NanoXML is not 100% XML 1.0 compliant:
<!ENTITY...>
.
<!CDATA...]]>
You can opt to use a SAX compatible API, by including both
nanoxml.jar
and nanoxml-sax.jar
in your classpath
and setting the property org.xml.sax.parser
to
nanoxml.sax.SAXParser
This class is part of NanoXML.
Copyright (C) 2000 Marc De Scheemaecker, All Rights Reserved.
XMLParseException
Field Summary | |
static int |
NANOXML_MAJOR_VERSION
Major version of NanoXML. |
static int |
NANOXML_MINOR_VERSION
Minor version of NanoXML. |
Constructor Summary | |
XMLElement()
Creates a new XML element. |
|
XMLElement(boolean skipLeadingWhitespace)
Creates a new XML element. |
|
XMLElement(Properties conversionTable)
Creates a new XML element. |
|
XMLElement(Properties conversionTable,
boolean skipLeadingWhitespace)
Creates a new XML element. |
Method Summary | |
int |
countChildren()
Returns the number of subobjects of the object. |
Enumeration |
enumerateChildren()
Enumerates the subobjects of the object. |
Enumeration |
enumeratePropertyNames()
Enumerates the attribute names. |
Vector |
getChildren()
Returns the subobjects of the object. |
String |
getContents()
Returns the #PCDATA content of the object. |
int |
getIntProperty(String key,
Hashtable valueSet,
String defaultValue)
Returns a property by looking up a key in a hashtable. |
int |
getLineNr()
Returns the line nr on which the element is found. |
String |
getProperty(String key)
Returns a property of the object. |
double |
getProperty(String key,
double defaultValue)
Returns a floating point property of the object. |
Object |
getProperty(String key,
Hashtable valueSet,
String defaultValue)
Returns a property by looking up a key in the hashtable valueSet. |
int |
getProperty(String key,
int defaultValue)
Returns an integer property of the object. |
String |
getProperty(String key,
String defaultValue)
Returns a property of the object. |
boolean |
getProperty(String key,
String trueValue,
String falseValue,
boolean defaultValue)
Returns a boolean property of the object. |
double |
getSpecialDoubleProperty(String key,
Hashtable valueSet,
String defaultValue)
Returns a property by looking up a key in the hashtable valueSet. |
int |
getSpecialIntProperty(String key,
Hashtable valueSet,
String defaultValue)
Returns a property by looking up a key in the hashtable valueSet. |
String |
getStringProperty(String key,
Hashtable valueSet,
String defaultValue)
Returns a property by looking up a key in the hashtable valueSet. |
String |
getTagName()
Returns the class (i.e. the name indicated in the tag) of the object. |
int |
parseCharArray(char[] input,
int offset,
int end)
Parses an XML definition starting at offset. |
int |
parseCharArray(char[] input,
int offset,
int end,
int startingLineNr)
Parses an XML definition starting at offset. |
void |
parseFromReader(Reader reader)
Reads an XML definition from a java.io.Reader and parses it. |
void |
parseFromReader(Reader reader,
int startingLineNr)
Reads an XML definition from a java.io.Reader and parses it. |
void |
parseString(String string)
Parses an XML definition. |
int |
parseString(String string,
int offset)
Parses an XML definition starting at offset. |
int |
parseString(String string,
int offset,
int end)
Parses an XML definition starting at offset. |
int |
parseString(String string,
int offset,
int end,
int startingLineNr)
Parses an XML definition starting at offset. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int NANOXML_MAJOR_VERSION
public static final int NANOXML_MINOR_VERSION
Constructor Detail |
public XMLElement()
& < >
' "
false
XMLElement(java.util.Properties)
,
XMLElement(boolean)
,
XMLElement(java.util.Properties,boolean)
public XMLElement(Properties conversionTable)
& < >
' "
false
XMLElement()
,
XMLElement(boolean)
,
XMLElement(java.util.Properties,boolean)
public XMLElement(boolean skipLeadingWhitespace)
& < >
' "
XMLElement()
,
XMLElement(java.util.Properties)
,
XMLElement(java.util.Properties,boolean)
public XMLElement(Properties conversionTable, boolean skipLeadingWhitespace)
& < >
' "
XMLElement()
,
XMLElement(boolean)
,
XMLElement(java.util.Properties)
Method Detail |
public int countChildren()
public Enumeration enumeratePropertyNames()
public Enumeration enumerateChildren()
public Vector getChildren()
public String getContents()
null
is returned.
public int getLineNr()
public int getIntProperty(String key, Hashtable valueSet, String defaultValue)
public String getProperty(String key)
null
.
public String getProperty(String key, String defaultValue)
public int getProperty(String key, int defaultValue)
public double getProperty(String key, double defaultValue)
public boolean getProperty(String key, String trueValue, String falseValue, boolean defaultValue)
public Object getProperty(String key, Hashtable valueSet, String defaultValue)
public String getStringProperty(String key, Hashtable valueSet, String defaultValue)
public int getSpecialIntProperty(String key, Hashtable valueSet, String defaultValue)
public double getSpecialDoubleProperty(String key, Hashtable valueSet, String defaultValue)
public String getTagName()
public void parseFromReader(Reader reader) throws IOException, XMLParseException
IOException
- if an error occured while reading the input
XMLParseException
- if an error occured while parsing the read datapublic void parseFromReader(Reader reader, int startingLineNr) throws IOException, XMLParseException
IOException
- if an error occured while reading the input
XMLParseException
- if an error occured while parsing the read datapublic void parseString(String string) throws XMLParseException
XMLParseException
- if an error occured while parsing the stringpublic int parseString(String string, int offset) throws XMLParseException
XMLParseException
- if an error occured while parsing the stringpublic int parseString(String string, int offset, int end) throws XMLParseException
XMLParseException
- if an error occured while parsing the stringpublic int parseString(String string, int offset, int end, int startingLineNr) throws XMLParseException
XMLParseException
- if an error occured while parsing the stringpublic int parseCharArray(char[] input, int offset, int end) throws XMLParseException
XMLParseException
- if an error occured while parsing the arraypublic int parseCharArray(char[] input, int offset, int end, int startingLineNr) throws XMLParseException
XMLParseException
- if an error occured while parsing the array
|
S-PLUS Connect/Java v1.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |