|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ximpleware.VTDGen
public class VTDGen
VTD Generator implementation. Current support built-in entities only It parses DTD, but doesn't resolve declared entities
Constructor Summary | |
---|---|
VTDGen()
VTDGen constructor method. |
Method Summary | |
---|---|
void |
clear()
Clear internal states so VTDGEn can process the next file. |
long |
getIndexSize()
Precompute the size of VTD+XML index |
VTDNav |
getNav()
This method returns the VTDNav object after parsing, it also cleans internal state so VTDGen can process the next file. |
VTDNav |
loadIndex(byte[] ba)
This method loads the VTD+XML from a byte array |
VTDNav |
loadIndex(java.io.InputStream is)
This method loads the VTD+XML from an input stream |
VTDNav |
loadIndex(java.lang.String fileName)
This method loads the VTD+XML from a file |
VTDNav |
loadSeparateIndex(java.lang.String XMLFileName,
java.lang.String VTDIndexName)
Load the separate VTD index and XmL file. |
void |
parse(boolean NS)
Generating VTD tokens and Location cache info. |
boolean |
parseFile(java.lang.String fileName,
boolean ns)
This method parses the XML file and returns a boolean indicating if it is successful or not. |
boolean |
parseHttpUrl(java.lang.String url,
boolean ns)
This method retrieves an XML document from the net using HTTP request If the returned content type is "application xml" then it will proceed with the parsing. |
void |
setDoc_BR(byte[] ba)
The buffer-reuse version of setDoc The concept is to reuse LC and VTD buffer for XML parsing, instead of allocating every time |
void |
setDoc_BR(byte[] ba,
int os,
int len)
The buffer-reuse version of setDoc The concept is to reuse LC and VTD buffer for XML parsing, instead of allocating every time |
void |
setDoc(byte[] ba)
Set the XMLDoc container. |
void |
setDoc(byte[] ba,
int os,
int len)
Set the XMLDoc container. |
void |
writeIndex(java.io.OutputStream os)
This method writes the VTD+XML into an outputStream |
void |
writeIndex(java.lang.String fileName)
This method writes the VTD+XML file into a file of the given name |
void |
writeSeparateIndex(java.io.OutputStream os)
This method writes the VTDs and LCs into an outputStream |
void |
writeSeparateIndex(java.lang.String fileName)
This method writes the VTDs and LCs into a file of the given name XML is not part of the index please refer to VTD-XML web site for the spec and explanation |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public long[] attr_name_array
public static final int FORMAT_ASCII
public static final int FORMAT_ISO_8859_1
public static final int FORMAT_ISO_8859_10
public static final int FORMAT_ISO_8859_11
public static final int FORMAT_ISO_8859_12
public static final int FORMAT_ISO_8859_13
public static final int FORMAT_ISO_8859_14
public static final int FORMAT_ISO_8859_15
public static final int FORMAT_ISO_8859_16
public static final int FORMAT_ISO_8859_2
public static final int FORMAT_ISO_8859_3
public static final int FORMAT_ISO_8859_4
public static final int FORMAT_ISO_8859_5
public static final int FORMAT_ISO_8859_6
public static final int FORMAT_ISO_8859_7
public static final int FORMAT_ISO_8859_8
public static final int FORMAT_ISO_8859_9
public static final int FORMAT_UTF_16BE
public static final int FORMAT_UTF_16LE
public static final int FORMAT_UTF8
public static final int FORMAT_WIN_1250
public static final int FORMAT_WIN_1251
public static final int FORMAT_WIN_1252
public static final int FORMAT_WIN_1253
public static final int FORMAT_WIN_1254
public static final int FORMAT_WIN_1255
public static final int FORMAT_WIN_1256
public static final int FORMAT_WIN_1257
public static final int FORMAT_WIN_1258
public static final int MAX_DEPTH
public static final int MAX_PREFIX_LENGTH
public static final int MAX_QNAME_LENGTH
public static final int MAX_TOKEN_LENGTH
public static final int TOKEN_ATTR_NAME
public static final int TOKEN_ATTR_NS
public static final int TOKEN_ATTR_VAL
public static final int TOKEN_CDATA_VAL
public static final int TOKEN_CHARACTER_DATA
public static final int TOKEN_COMMENT
public static final int TOKEN_DEC_ATTR_NAME
public static final int TOKEN_DEC_ATTR_VAL
public static final int TOKEN_DOCUMENT
public static final int TOKEN_DTD_VAL
public static final int TOKEN_ENDING_TAG
public static final int TOKEN_PI_NAME
public static final int TOKEN_PI_VAL
public static final int TOKEN_STARTING_TAG
Constructor Detail |
---|
public VTDGen()
Method Detail |
---|
public void clear()
public long getIndexSize()
public VTDNav getNav()
public VTDNav loadIndex(byte[] ba) throws java.io.IOException, IndexReadException
ba
-
java.io.IOException
IndexReadException
public VTDNav loadIndex(java.io.InputStream is) throws java.io.IOException, IndexReadException
is
-
java.io.IOException
IndexReadException
public VTDNav loadIndex(java.lang.String fileName) throws java.io.IOException, IndexReadException
fileName
-
java.io.IOException
IndexReadException
public VTDNav loadSeparateIndex(java.lang.String XMLFileName, java.lang.String VTDIndexName) throws java.io.IOException, IndexReadException
XMLFileName
- name of xml fileVTDIndexName
- name of the vtd index file
java.io.IOException
IndexReadException
public void parse(boolean NS) throws com.ximpleware.EncodingException, com.ximpleware.EOFException, com.ximpleware.EntityException, ParseException
NS
- boolean Enable namespace or not
ParseException
- Super class for any exceptions during parsing.
EOFException
- End of file exception.
EntityException
- Entity resolution exception.
EncodingException
- UTF/native encoding exception.public boolean parseFile(java.lang.String fileName, boolean ns)
fileName
- ns
- namespace aware or not
public boolean parseHttpUrl(java.lang.String url, boolean ns)
url
-
public void setDoc_BR(byte[] ba)
ba
- public void setDoc_BR(byte[] ba, int os, int len)
ba
- byte[]os
- int (in byte)len
- int (in byte)public void setDoc(byte[] ba)
ba
- byte[]public void setDoc(byte[] ba, int os, int len)
ba
- byte[]os
- int (in byte)len
- int (in byte)public void writeIndex(java.io.OutputStream os) throws java.io.IOException, IndexWriteException
os
-
java.io.IOException
IndexWriteException
public void writeIndex(java.lang.String fileName) throws java.io.IOException, IndexWriteException
fileName
-
java.io.IOException
IndexWriteException
public void writeSeparateIndex(java.io.OutputStream os) throws java.io.IOException, IndexWriteException
os
-
java.io.IOException
IndexWriteException
public void writeSeparateIndex(java.lang.String fileName) throws java.io.IOException, IndexWriteException
fileName
-
java.io.IOException
IndexWriteException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |