C# Class com.ximpleware.VTDGen

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

Méthodes publiques

Свойство Type Description
e com.ximpleware.EOFException

Protected Properties

Свойство 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

Свойство 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

Méthodes publiques

Méthode 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

Méthode 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 méthode

VTDGen constructor method.
public VTDGen ( ) : System
Résultat System

clear() public méthode

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

enableIgnoredWhiteSpace() public méthode

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
Résultat void

getIndexSize() public méthode

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

getNav() public méthode

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
Résultat VTDNav

loadIndex() public méthode

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

loadIndex() public méthode

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
Résultat VTDNav

loadSeparateIndex() public méthode

public loadSeparateIndex ( String XMLFileName, String VTDFileName ) : VTDNav
XMLFileName String
VTDFileName String
Résultat VTDNav

parse() public méthode

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 ///
Résultat void

parseFile() public méthode

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

parseHttpUrl() public méthode

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
Résultat bool

selectLcDepth() public méthode

public selectLcDepth ( int i ) : void
i int
Résultat void

setDoc() public méthode

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

setDoc() public méthode

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) ///
Résultat void

setDoc_BR() public méthode

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 * ///
Résultat void

setDoc_BR() public méthode

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) /// ///
Résultat void

writeIndex() public méthode

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

writeSeparateIndex() public méthode

public writeSeparateIndex ( String fileName ) : void
fileName String
Résultat void

writeSeparateIndex() public méthode

public writeSeparateIndex ( System os ) : void
os System
Résultat void

Property Details

LcDepth protected_oe property

protected short LcDepth
Résultat short

VTDBuffer protected_oe property

protected FastLongBuffer,com.ximpleware VTDBuffer
Résultat com.ximpleware.FastLongBuffer

VTDDepth protected_oe property

protected int VTDDepth
Résultat int

XMLDoc protected_oe property

protected byte[] XMLDoc
Résultat byte[]

_l3Buffer protected_oe property

protected FastLongBuffer,com.ximpleware _l3Buffer
Résultat com.ximpleware.FastLongBuffer

_l4Buffer protected_oe property

protected FastLongBuffer,com.ximpleware _l4Buffer
Résultat com.ximpleware.FastLongBuffer

_l5Buffer protected_oe property

protected FastIntBuffer,com.ximpleware _l5Buffer
Résultat com.ximpleware.FastIntBuffer

br protected_oe property

protected bool br
Résultat bool

currentElementRecord protected_oe property

protected long currentElementRecord
Résultat long

default_ns protected_oe property

protected bool default_ns
Résultat bool

depth protected_oe property

protected int depth
Résultat int

docLen protected_oe property

protected int docLen
Résultat int

docOffset protected_oe property

protected int docOffset
Résultat int

e public_oe property

public EOFException,com.ximpleware e
Résultat com.ximpleware.EOFException

encoding protected_oe property

protected int encoding
Résultat int

endOffset protected_oe property

protected int endOffset
Résultat int

helper protected_oe property

protected bool helper
Résultat bool

isXML protected_oe property

protected bool isXML
Résultat bool

l1Buffer protected_oe property

protected FastLongBuffer,com.ximpleware l1Buffer
Résultat com.ximpleware.FastLongBuffer

l2Buffer protected_oe property

protected FastLongBuffer,com.ximpleware l2Buffer
Résultat com.ximpleware.FastLongBuffer

l3Buffer protected_oe property

protected FastIntBuffer,com.ximpleware l3Buffer
Résultat com.ximpleware.FastIntBuffer

ns protected_oe property

protected bool ns
Résultat bool

nsBuffer1 protected_oe property

protected FastIntBuffer,com.ximpleware nsBuffer1
Résultat com.ximpleware.FastIntBuffer

nsBuffer2 protected_oe property

protected FastLongBuffer,com.ximpleware nsBuffer2
Résultat com.ximpleware.FastLongBuffer

nsBuffer3 protected_oe property

protected FastLongBuffer,com.ximpleware nsBuffer3
Résultat com.ximpleware.FastLongBuffer

offset protected_oe property

protected int offset
Résultat int

prev_offset protected_oe property

protected int prev_offset
Résultat int

r protected_oe property

protected IReader r
Résultat IReader

rootIndex protected_oe property

protected int rootIndex
Résultat int

shallowDepth protected_oe property

protected bool shallowDepth
Résultat bool

singleByteEncoding protected_oe property

protected bool singleByteEncoding
Résultat bool

tag_stack protected_oe property

protected long[] tag_stack
Résultat long[]