C# Class com.ximpleware.VTDGen

VTD Generator implementation. Current support built-in entities only It parses DTD, but doesn't resolve declared entities
Exibir arquivo Open project: jzhang2004/vtd-xml Class Usage Examples

Public Properties

Property Type Description
e com.ximpleware.EOFException

Protected Properties

Property Type Description
LcDepth short
VTDBuffer com.ximpleware.FastLongBuffer
VTDDepth int
XMLDoc byte[]
_l3Buffer com.ximpleware.FastLongBuffer
_l4Buffer com.ximpleware.FastLongBuffer
_l5Buffer com.ximpleware.FastIntBuffer
br bool
currentElementRecord long
default_ns bool
depth int
docLen int
docOffset int
encoding int
endOffset int
helper bool
isXML bool
l1Buffer com.ximpleware.FastLongBuffer
l2Buffer com.ximpleware.FastLongBuffer
l3Buffer com.ximpleware.FastIntBuffer
ns bool
nsBuffer1 com.ximpleware.FastIntBuffer
nsBuffer2 com.ximpleware.FastLongBuffer
nsBuffer3 com.ximpleware.FastLongBuffer
offset int
prev_offset int
r IReader
rootIndex int
shallowDepth bool
singleByteEncoding bool
tag_stack long[]

Private Properties

Property Type Description
_getCharResolved long
_writeVTD void
addWhiteSpaceRecord void
checkAttributeUniqueness void
checkPrefix bool
checkPrefix2 bool
checkQualifiedAttributeUniqueness void
decide_encoding void
disallow_xmlns void
entityIdentifier int
finishUp void
formatLineNumber String
formatLineNumber String
getCharUnit int
handleOtherTextChar void
handleOtherTextChar2 void
identifyNsURL int
matchCPEncoding void
matchISOEncoding void
matchURL bool
matchUTFEncoding void
matchWindowsEncoding void
matchXML bool
processElementTail int
process_attr_name void
process_attr_val int
process_cdata int
process_comment int
process_dec_attr int
process_doc_type int
process_end_comment int
process_end_doc int
process_end_pi int
process_ex_seen int
process_pi_tag int
process_pi_val int
process_qm_seen int
process_start_doc int
qualifyAttributes void
qualifyElement void
writeVTD void
writeVTDText void
writeVTD_L5 void

Public Methods

Method Description
VTDGen ( ) : System

VTDGen constructor method.

clear ( ) : void

Clear internal states so VTDGEn can process the next file.

enableIgnoredWhiteSpace ( bool b ) : void

Enable the parser to collect all white spaces, including the ignored white spaces By default, ignore white spaces are ignored

getIndexSize ( ) : long

Precompute the size of VTD+XML index without actully generating it

getNav ( ) : VTDNav

The entity aware version of getCharAfterS

This method returns the VTDNav object after parsing, it also cleans internal state so VTDGen can process the next file.

loadIndex ( System is_Renamed ) : VTDNav

This method loads the VTD+XML from an input stream

loadIndex ( byte ba ) : VTDNav

This method loads the VTD+XML from a byte array, assuming the first 32 bytes are not XML bytes (but instead header of the VTD+XML index)

loadSeparateIndex ( String XMLFileName, String VTDFileName ) : VTDNav
parse ( bool NS ) : void

Generating VTD tokens and Location cache info. VTDGen conforms to XML namespace 1.0 spec

parseFile ( String fileName, bool ns ) : bool

parse a file directly

parseHttpUrl ( String url, bool ns ) : bool

This method grabs an XML doc from the net using HTTP get

selectLcDepth ( int i ) : void

setDoc ( byte ba ) : void

Set the XMLDoc container.

setDoc ( byte ba, int os, int len ) : void

Set the XMLDoc container. Also set the offset and len of the document with respect to the container.

setDoc_BR ( byte ba ) : void

The buffer-reuse version of setDoc The concept is to reuse LC and VTD buffer for XML parsing, instead of allocating every time

setDoc_BR ( byte ba, int os, int len ) : void

The buffer-reuse version of setDoc The concept is to reuse LC and VTD buffer for XML parsing, instead of allocating every time

writeIndex ( System os ) : void

This method writes the VTD+XML into an output streams

writeSeparateIndex ( String fileName ) : void
writeSeparateIndex ( System os ) : void

Private Methods

Method Description
_getCharResolved ( int byte_offset ) : long
_writeVTD ( int offset, int length, int token_type, int depth ) : void
addWhiteSpaceRecord ( ) : void

checkAttributeUniqueness ( ) : void
checkPrefix ( int os, int len ) : bool
checkPrefix2 ( int os, int len ) : bool
checkQualifiedAttributeUniqueness ( ) : void
decide_encoding ( ) : void

A private method that detects the BOM and decides document encoding

disallow_xmlns ( int byte_offset ) : void
entityIdentifier ( ) : int

This method will detect whether the entity is valid or not and increment offset.

finishUp ( ) : void

Write the remaining portion of LC info

formatLineNumber ( ) : String

Format the string indicating the position (line number:offset)of the offset if there is an exception.

formatLineNumber ( int os ) : String
getCharUnit ( int byte_offset ) : int
handleOtherTextChar ( int ch ) : void
handleOtherTextChar2 ( int ch ) : void
identifyNsURL ( int byte_offset, int length ) : int
matchCPEncoding ( ) : void
matchISOEncoding ( ) : void
matchURL ( int bos1, int len1, int bos2, int len2 ) : bool
matchUTFEncoding ( ) : void
matchWindowsEncoding ( ) : void
matchXML ( int byte_offset ) : bool
processElementTail ( bool helper ) : int
process_attr_name ( ) : void
process_attr_val ( ) : int
process_cdata ( ) : int

This private method processes CDATA section

process_comment ( ) : int

This private method process comment

process_dec_attr ( ) : int

This private method processes declaration attributes

process_doc_type ( ) : int

This private method process DTD

process_end_comment ( ) : int

This private method process the comment after the root document

process_end_doc ( ) : int
process_end_pi ( ) : int

This private method processes PI after root document

process_ex_seen ( ) : int
process_pi_tag ( ) : int

This private method processes PI tag

process_pi_val ( ) : int

This private method processes PI val

process_qm_seen ( ) : int
process_start_doc ( ) : int
qualifyAttributes ( ) : void
qualifyElement ( ) : void
writeVTD ( int offset, int length, int token_type, int depth ) : void

Write the VTD and LC into their storage container.

writeVTDText ( int offset, int length, int token_type, int depth ) : void
writeVTD_L5 ( int offset, int length, int token_type, int depth ) : void

Method Details

VTDGen() public method

VTDGen constructor method.
public VTDGen ( ) : System
return System

clear() public method

Clear internal states so VTDGEn can process the next file.
public clear ( ) : void
return void

enableIgnoredWhiteSpace() public method

Enable the parser to collect all white spaces, including the ignored white spaces By default, ignore white spaces are ignored
public enableIgnoredWhiteSpace ( bool b ) : void
b bool
return void

getIndexSize() public method

Precompute the size of VTD+XML index without actully generating it
public getIndexSize ( ) : long
return long

getNav() public method

The entity aware version of getCharAfterS This method returns the VTDNav object after parsing, it also cleans internal state so VTDGen can process the next file.
public getNav ( ) : VTDNav
return VTDNav

loadIndex() public method

This method loads the VTD+XML from an input stream
public loadIndex ( System is_Renamed ) : VTDNav
is_Renamed System
return VTDNav

loadIndex() public method

This method loads the VTD+XML from a byte array, assuming the first 32 bytes are not XML bytes (but instead header of the VTD+XML index)
public loadIndex ( byte ba ) : VTDNav
ba byte
return VTDNav

loadSeparateIndex() public method

public loadSeparateIndex ( String XMLFileName, String VTDFileName ) : VTDNav
XMLFileName String
VTDFileName String
return VTDNav

parse() public method

Generating VTD tokens and Location cache info. VTDGen conforms to XML namespace 1.0 spec
public parse ( bool NS ) : void
NS bool boolean Enable namespace or not ///
return void

parseFile() public method

parse a file directly
public parseFile ( String fileName, bool ns ) : bool
fileName String Name of the file to be parsed
ns bool namespace awareness
return bool

parseHttpUrl() public method

This method grabs an XML doc from the net using HTTP get
public parseHttpUrl ( String url, bool ns ) : bool
url String
ns bool namespace aware or not
return bool

selectLcDepth() public method

public selectLcDepth ( int i ) : void
i int
return void

setDoc() public method

Set the XMLDoc container.
public setDoc ( byte ba ) : void
ba byte byte[] ///
return void

setDoc() public method

Set the XMLDoc container. Also set the offset and len of the document with respect to the container.
public setDoc ( byte ba, int os, int len ) : void
ba byte byte[] ///
os int int (in byte) ///
len int int (in byte) ///
return void

setDoc_BR() public method

The buffer-reuse version of setDoc The concept is to reuse LC and VTD buffer for XML parsing, instead of allocating every time
public setDoc_BR ( byte ba ) : void
ba byte * ///
return void

setDoc_BR() public method

The buffer-reuse version of setDoc The concept is to reuse LC and VTD buffer for XML parsing, instead of allocating every time
public setDoc_BR ( byte ba, int os, int len ) : void
ba byte byte[] ///
os int int (in byte) ///
len int int (in byte) /// ///
return void

writeIndex() public method

This method writes the VTD+XML into an output streams
public writeIndex ( System os ) : void
os System ///
return void

writeSeparateIndex() public method

public writeSeparateIndex ( String fileName ) : void
fileName String
return void

writeSeparateIndex() public method

public writeSeparateIndex ( System os ) : void
os System
return void

Property Details

LcDepth protected_oe property

protected short LcDepth
return short

VTDBuffer protected_oe property

protected FastLongBuffer,com.ximpleware VTDBuffer
return com.ximpleware.FastLongBuffer

VTDDepth protected_oe property

protected int VTDDepth
return int

XMLDoc protected_oe property

protected byte[] XMLDoc
return byte[]

_l3Buffer protected_oe property

protected FastLongBuffer,com.ximpleware _l3Buffer
return com.ximpleware.FastLongBuffer

_l4Buffer protected_oe property

protected FastLongBuffer,com.ximpleware _l4Buffer
return com.ximpleware.FastLongBuffer

_l5Buffer protected_oe property

protected FastIntBuffer,com.ximpleware _l5Buffer
return com.ximpleware.FastIntBuffer

br protected_oe property

protected bool br
return bool

currentElementRecord protected_oe property

protected long currentElementRecord
return long

default_ns protected_oe property

protected bool default_ns
return bool

depth protected_oe property

protected int depth
return int

docLen protected_oe property

protected int docLen
return int

docOffset protected_oe property

protected int docOffset
return int

e public_oe property

public EOFException,com.ximpleware e
return com.ximpleware.EOFException

encoding protected_oe property

protected int encoding
return int

endOffset protected_oe property

protected int endOffset
return int

helper protected_oe property

protected bool helper
return bool

isXML protected_oe property

protected bool isXML
return bool

l1Buffer protected_oe property

protected FastLongBuffer,com.ximpleware l1Buffer
return com.ximpleware.FastLongBuffer

l2Buffer protected_oe property

protected FastLongBuffer,com.ximpleware l2Buffer
return com.ximpleware.FastLongBuffer

l3Buffer protected_oe property

protected FastIntBuffer,com.ximpleware l3Buffer
return com.ximpleware.FastIntBuffer

ns protected_oe property

protected bool ns
return bool

nsBuffer1 protected_oe property

protected FastIntBuffer,com.ximpleware nsBuffer1
return com.ximpleware.FastIntBuffer

nsBuffer2 protected_oe property

protected FastLongBuffer,com.ximpleware nsBuffer2
return com.ximpleware.FastLongBuffer

nsBuffer3 protected_oe property

protected FastLongBuffer,com.ximpleware nsBuffer3
return com.ximpleware.FastLongBuffer

offset protected_oe property

protected int offset
return int

prev_offset protected_oe property

protected int prev_offset
return int

r protected_oe property

protected IReader r
return IReader

rootIndex protected_oe property

protected int rootIndex
return int

shallowDepth protected_oe property

protected bool shallowDepth
return bool

singleByteEncoding protected_oe property

protected bool singleByteEncoding
return bool

tag_stack protected_oe property

protected long[] tag_stack
return long[]