C# Класс com.ximpleware.VTDGen

VTD Generator implementation. Current support built-in entities only It parses DTD, but doesn't resolve declared entities
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
e com.ximpleware.EOFException

Защищенные свойства (Protected)

Свойство Тип Описание
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

Свойство Тип Описание
_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

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
_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

Описание методов

VTDGen() публичный Метод

VTDGen constructor method.
public VTDGen ( ) : System
Результат System

clear() публичный Метод

Clear internal states so VTDGEn can process the next file.
public clear ( ) : void
Результат void

enableIgnoredWhiteSpace() публичный Метод

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
Результат void

getIndexSize() публичный Метод

Precompute the size of VTD+XML index without actully generating it
public getIndexSize ( ) : long
Результат long

getNav() публичный Метод

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
Результат VTDNav

loadIndex() публичный Метод

This method loads the VTD+XML from an input stream
public loadIndex ( System is_Renamed ) : VTDNav
is_Renamed System
Результат VTDNav

loadIndex() публичный Метод

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
Результат VTDNav

loadSeparateIndex() публичный Метод

public loadSeparateIndex ( String XMLFileName, String VTDFileName ) : VTDNav
XMLFileName String
VTDFileName String
Результат VTDNav

parse() публичный Метод

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 ///
Результат void

parseFile() публичный Метод

parse a file directly
public parseFile ( String fileName, bool ns ) : bool
fileName String Name of the file to be parsed
ns bool namespace awareness
Результат bool

parseHttpUrl() публичный Метод

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
Результат bool

selectLcDepth() публичный Метод

public selectLcDepth ( int i ) : void
i int
Результат void

setDoc() публичный Метод

Set the XMLDoc container.
public setDoc ( byte ba ) : void
ba byte byte[] ///
Результат void

setDoc() публичный Метод

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) ///
Результат void

setDoc_BR() публичный Метод

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 * ///
Результат void

setDoc_BR() публичный Метод

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) /// ///
Результат void

writeIndex() публичный Метод

This method writes the VTD+XML into an output streams
public writeIndex ( System os ) : void
os System ///
Результат void

writeSeparateIndex() публичный Метод

public writeSeparateIndex ( String fileName ) : void
fileName String
Результат void

writeSeparateIndex() публичный Метод

public writeSeparateIndex ( System os ) : void
os System
Результат void

Описание свойств

LcDepth защищенное свойство

protected short LcDepth
Результат short

VTDBuffer защищенное свойство

protected FastLongBuffer,com.ximpleware VTDBuffer
Результат com.ximpleware.FastLongBuffer

VTDDepth защищенное свойство

protected int VTDDepth
Результат int

XMLDoc защищенное свойство

protected byte[] XMLDoc
Результат byte[]

_l3Buffer защищенное свойство

protected FastLongBuffer,com.ximpleware _l3Buffer
Результат com.ximpleware.FastLongBuffer

_l4Buffer защищенное свойство

protected FastLongBuffer,com.ximpleware _l4Buffer
Результат com.ximpleware.FastLongBuffer

_l5Buffer защищенное свойство

protected FastIntBuffer,com.ximpleware _l5Buffer
Результат com.ximpleware.FastIntBuffer

br защищенное свойство

protected bool br
Результат bool

currentElementRecord защищенное свойство

protected long currentElementRecord
Результат long

default_ns защищенное свойство

protected bool default_ns
Результат bool

depth защищенное свойство

protected int depth
Результат int

docLen защищенное свойство

protected int docLen
Результат int

docOffset защищенное свойство

protected int docOffset
Результат int

e публичное свойство

public EOFException,com.ximpleware e
Результат com.ximpleware.EOFException

encoding защищенное свойство

protected int encoding
Результат int

endOffset защищенное свойство

protected int endOffset
Результат int

helper защищенное свойство

protected bool helper
Результат bool

isXML защищенное свойство

protected bool isXML
Результат bool

l1Buffer защищенное свойство

protected FastLongBuffer,com.ximpleware l1Buffer
Результат com.ximpleware.FastLongBuffer

l2Buffer защищенное свойство

protected FastLongBuffer,com.ximpleware l2Buffer
Результат com.ximpleware.FastLongBuffer

l3Buffer защищенное свойство

protected FastIntBuffer,com.ximpleware l3Buffer
Результат com.ximpleware.FastIntBuffer

ns защищенное свойство

protected bool ns
Результат bool

nsBuffer1 защищенное свойство

protected FastIntBuffer,com.ximpleware nsBuffer1
Результат com.ximpleware.FastIntBuffer

nsBuffer2 защищенное свойство

protected FastLongBuffer,com.ximpleware nsBuffer2
Результат com.ximpleware.FastLongBuffer

nsBuffer3 защищенное свойство

protected FastLongBuffer,com.ximpleware nsBuffer3
Результат com.ximpleware.FastLongBuffer

offset защищенное свойство

protected int offset
Результат int

prev_offset защищенное свойство

protected int prev_offset
Результат int

r защищенное свойство

protected IReader r
Результат IReader

rootIndex защищенное свойство

protected int rootIndex
Результат int

shallowDepth защищенное свойство

protected bool shallowDepth
Результат bool

singleByteEncoding защищенное свойство

protected bool singleByteEncoding
Результат bool

tag_stack защищенное свойство

protected long[] tag_stack
Результат long[]