|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.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. |
void |
enableIgnoredWhiteSpace(boolean b)
Enable the parser to collect all white spaces, including the trivial white spaces By default, trivial white spaces are ignored |
long |
getIndexSize()
Pre-compute 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(InputStream is)
This method loads the VTD+XML from an input stream |
VTDNav |
loadIndex(String fileName)
This method loads the VTD+XML from a file |
VTDNav |
loadSeparateIndex(String XMLFileName,
String VTDIndexName)
Load the separate VTD index and XmL file. |
void |
parse(boolean NS)
Generating VTD tokens and Location cache info. |
boolean |
parseFile(String fileName,
boolean ns)
This method parses the XML file and returns a boolean indicating if it is successful or not.When set to true, VTDGen conforms to XML namespace 1.0 spec |
boolean |
parseGZIPFile(String GZIPfileName,
boolean ns)
This method inflates then parses GZIP'ed XML file and returns a boolean indicating if it is successful or not.When set to true, VTDGen conforms to XML namespace 1.0 spec |
boolean |
parseHttpUrl(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. |
boolean |
parseZIPFile(String ZIPfileName,
String XMLName,
boolean ns)
This method inflates then parses ZIP'ed XML file and returns a boolean indicating if it is successful or not.When set to true, VTDGen conforms to XML namespace 1.0 spec |
void |
selectLcDepth(int i)
Enable VTDGen to generate Location Cache of either depth 3 or 5 This method is meant to called before setDoc() or parseFile() |
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(OutputStream os)
This method writes the VTD+XML into an outputStream |
void |
writeIndex(String fileName)
This method writes the VTD+XML file into a file of the given name |
void |
writeSeparateIndex(OutputStream os)
This method writes the VTDs and LCs into an outputStream |
void |
writeSeparateIndex(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 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
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
protected byte[] XMLDoc
protected com.ximpleware.IReader r
protected int offset
protected int depth
protected boolean helper
protected boolean default_ns
protected boolean isXML
protected boolean singleByteEncoding
protected boolean shallowDepth
protected boolean ns
protected boolean is_ns
protected boolean br
protected int endOffset
protected int prev_offset
protected long[] tag_stack
protected FastLongBuffer VTDBuffer
protected FastLongBuffer l1Buffer
protected FastLongBuffer l2Buffer
protected FastIntBuffer l3Buffer
protected FastLongBuffer _l3Buffer
protected FastLongBuffer _l4Buffer
protected FastIntBuffer _l5Buffer
protected FastIntBuffer nsBuffer1
protected FastLongBuffer nsBuffer2
protected FastLongBuffer nsBuffer3
protected EOFException e
protected int docLen
protected int docOffset
protected int encoding
protected boolean ws
protected int rootIndex
protected int VTDDepth
protected short LcDepth
protected long currentElementRecord
| Constructor Detail |
|---|
public VTDGen()
| Method Detail |
|---|
public void clear()
public void enableIgnoredWhiteSpace(boolean b)
b -
public void selectLcDepth(int i)
throws ParseException
i -
ParseExceptionpublic long getIndexSize()
public VTDNav getNav()
public VTDNav loadIndex(byte[] ba)
throws IOException,
IndexReadException
ba -
IOException
IndexReadException
public VTDNav loadIndex(InputStream is)
throws IOException,
IndexReadException
is -
IOException
IndexReadException
public VTDNav loadIndex(String fileName)
throws IOException,
IndexReadException
fileName -
IOException
IndexReadException
public VTDNav loadSeparateIndex(String XMLFileName,
String VTDIndexName)
throws IOException,
IndexReadException
XMLFileName - name of xml fileVTDIndexName - name of the vtd index file
IOException
IndexReadException
public void parse(boolean NS)
throws EncodingException,
EOFException,
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(String fileName,
boolean ns)
fileName - ns - namespace aware or not
public boolean parseGZIPFile(String GZIPfileName,
boolean ns)
fileName - ns -
public boolean parseZIPFile(String ZIPfileName,
String XMLName,
boolean ns)
ZIPfileName - XMLName - ns -
public boolean parseHttpUrl(String url,
boolean ns)
url -
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 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 writeIndex(OutputStream os)
throws IOException,
IndexWriteException
os -
IOException
IndexWriteException
public void writeSeparateIndex(OutputStream os)
throws IOException,
IndexWriteException
os -
IOException
IndexWriteException
public void writeIndex(String fileName)
throws IOException,
IndexWriteException
fileName -
IOException
IndexWriteException
public void writeSeparateIndex(String fileName)
throws IOException,
IndexWriteException
fileName -
IOException
IndexWriteException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||