Top Fields Constructors Methods
com.sun.xml.fastinfoset.tools

public Class VocabularyGenerator

extends DefaultHandler
implements LexicalHandler
Class Inheritance
All Implemented Interfaces
org.xml.sax.ext.LexicalHandler
Imports
com.sun.xml.fastinfoset.QualifiedName, .CommonResourceBundle, com.sun.xml.fastinfoset.util.CharArray, .DuplicateAttributeVerifier, .KeyIntMap, .LocalNameQualifiedNamesMap, .PrefixArray, .QualifiedNameArray, .StringArray, .StringIntMap, com.sun.xml.fastinfoset.vocab.ParserVocabulary, .SerializerVocabulary, org.xml.sax.Attributes, .SAXException, org.xml.sax.ext.LexicalHandler, org.xml.sax.helpers.DefaultHandler, java.util.Set, javax.xml.namespace.QName, org.jvnet.fastinfoset.FastInfosetSerializer

Field Summary

Modifier and TypeField and Description
protected ParserVocabulary
protected SerializerVocabulary
protected Vocabulary
protected int
protected int

Constructor Summary

AccessConstructor and Description
public
VocabularyGenerator()

Creates a new instance of VocabularyGenerator

public
public
public
VocabularyGenerator(SerializerVocabulary serializerVocabulary, ParserVocabulary parserVocabulary)

Creates a new instance of VocabularyGenerator

Method Summary

Modifier and TypeMethod and Description
public void
public void
addToNameTable(String namespaceURI, String qName, String localName, Set<QName> v, LocalNameQualifiedNamesMap m, QualifiedNameArray a, boolean isAttribute)

public void
public void
public void
characters(char[] ch, int start, int length)

Overrides org.xml.sax.helpers.DefaultHandler.characters.

Implements org.xml.sax.ContentHandler.characters.

Receive notification of character data inside an element.

public void
comment(char[] ch, int start, int length)

Implements org.xml.sax.ext.LexicalHandler.comment.

Report an XML comment anywhere in the document.

public void
endCDATA()

Implements org.xml.sax.ext.LexicalHandler.endCDATA.

Report the end of a CDATA section.

public void
endDTD()

Implements org.xml.sax.ext.LexicalHandler.endDTD.

Report the end of DTD declarations.

public void
endEntity(String name)

Implements org.xml.sax.ext.LexicalHandler.endEntity.

Report the end of an entity.

public int
public int
public static String
public Vocabulary
public void
public void
public void
startCDATA()

Implements org.xml.sax.ext.LexicalHandler.startCDATA.

Report the start of a CDATA section.

public void
startDTD(String name, String publicId, String systemId)

Implements org.xml.sax.ext.LexicalHandler.startDTD.

Report the start of DTD declarations, if any.

public void
startElement(String namespaceURI, String localName, String qName, Attributes atts)

Overrides org.xml.sax.helpers.DefaultHandler.startElement.

Implements org.xml.sax.ContentHandler.startElement.

Receive notification of the start of an element.

public void
startEntity(String name)

Implements org.xml.sax.ext.LexicalHandler.startEntity.

Report the beginning of some internal and external XML entities.

public void
startPrefixMapping(String prefix, String uri)

Overrides org.xml.sax.helpers.DefaultHandler.startPrefixMapping.

Implements org.xml.sax.ContentHandler.startPrefixMapping.

Receive notification of the start of a Namespace mapping.

Inherited from org.xml.sax.helpers.DefaultHandler:
endDocumentendElementendPrefixMappingerrorfatalErrorignorableWhitespacenotationDeclprocessingInstructionresolveEntitysetDocumentLocatorskippedEntitystartDocumentunparsedEntityDeclwarning

Field Detail

_parserVocabularyback to summary
protected ParserVocabulary _parserVocabulary
_serializerVocabularyback to summary
protected SerializerVocabulary _serializerVocabulary
_vback to summary
protected Vocabulary _v
attributeValueSizeConstraintback to summary
protected int attributeValueSizeConstraint
characterContentChunkSizeContraintback to summary
protected int characterContentChunkSizeContraint

Constructor Detail

VocabularyGeneratorback to summary
public VocabularyGenerator()

Creates a new instance of VocabularyGenerator

VocabularyGeneratorback to summary
public VocabularyGenerator(SerializerVocabulary serializerVocabulary)
VocabularyGeneratorback to summary
public VocabularyGenerator(ParserVocabulary parserVocabulary)
VocabularyGeneratorback to summary
public VocabularyGenerator(SerializerVocabulary serializerVocabulary, ParserVocabulary parserVocabulary)

Creates a new instance of VocabularyGenerator

Method Detail

addToCharArrayTableback to summary
public void addToCharArrayTable(CharArray c)
addToNameTableback to summary
public void addToNameTable(String namespaceURI, String qName, String localName, Set<QName> v, LocalNameQualifiedNamesMap m, QualifiedNameArray a, boolean isAttribute) throws SAXException
addToTableback to summary
public void addToTable(String s, Set<String> v, StringIntMap m, StringArray a)
addToTableback to summary
public void addToTable(String s, Set<String> v, StringIntMap m, PrefixArray a)
charactersback to summary
public void characters(char[] ch, int start, int length) throws SAXException

Overrides org.xml.sax.helpers.DefaultHandler.characters.

Implements org.xml.sax.ContentHandler.characters.

Doc from org.xml.sax.helpers.DefaultHandler.characters.

Receive notification of character data inside an element.

By default, do nothing. Application writers may override this method to take specific actions for each chunk of character data (such as adding the data to a node or buffer, or printing it to a file).

Annotations
@Override
Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
commentback to summary
public void comment(char[] ch, int start, int length) throws SAXException

Implements org.xml.sax.ext.LexicalHandler.comment.

Doc from org.xml.sax.ext.LexicalHandler.comment.

Report an XML comment anywhere in the document.

This callback will be used for comments inside or outside the document element, including comments in the external DTD subset (if read). Comments in the DTD must be properly nested inside start/endDTD and start/endEntity events (if used).

Annotations
@Override
Exceptions
SAXException:
The application may raise an exception.
endCDATAback to summary
public void endCDATA() throws SAXException

Implements org.xml.sax.ext.LexicalHandler.endCDATA.

Doc from org.xml.sax.ext.LexicalHandler.endCDATA.

Report the end of a CDATA section.

Annotations
@Override
Exceptions
SAXException:
The application may raise an exception.
endDTDback to summary
public void endDTD() throws SAXException

Implements org.xml.sax.ext.LexicalHandler.endDTD.

Doc from org.xml.sax.ext.LexicalHandler.endDTD.

Report the end of DTD declarations.

This method is intended to report the end of the DOCTYPE declaration; if the document has no DOCTYPE declaration, this method will not be invoked.

Annotations
@Override
Exceptions
SAXException:
The application may raise an exception.
endEntityback to summary
public void endEntity(String name) throws SAXException

Implements org.xml.sax.ext.LexicalHandler.endEntity.

Doc from org.xml.sax.ext.LexicalHandler.endEntity.

Report the end of an entity.

Annotations
@Override
Exceptions
SAXException:
The application may raise an exception.
getAttributeValueSizeLimitback to summary
public int getAttributeValueSizeLimit()
getCharacterContentChunkSizeLimitback to summary
public int getCharacterContentChunkSizeLimit()
getPrefixFromQualifiedNameback to summary
public static String getPrefixFromQualifiedName(String qName)
getVocabularyback to summary
public Vocabulary getVocabulary()
setAttributeValueSizeLimitback to summary
public void setAttributeValueSizeLimit(int size)
setCharacterContentChunkSizeLimitback to summary
public void setCharacterContentChunkSizeLimit(int size)
startCDATAback to summary
public void startCDATA() throws SAXException

Implements org.xml.sax.ext.LexicalHandler.startCDATA.

Doc from org.xml.sax.ext.LexicalHandler.startCDATA.

Report the start of a CDATA section.

The contents of the CDATA section will be reported through the regular characters event; this event is intended only to report the boundary.

Annotations
@Override
Exceptions
SAXException:
The application may raise an exception.
startDTDback to summary
public void startDTD(String name, String publicId, String systemId) throws SAXException

Implements org.xml.sax.ext.LexicalHandler.startDTD.

Doc from org.xml.sax.ext.LexicalHandler.startDTD.

Report the start of DTD declarations, if any.

This method is intended to report the beginning of the DOCTYPE declaration; if the document has no DOCTYPE declaration, this method will not be invoked.

All declarations reported through DTDHandler or DeclHandler events must appear between the startDTD and endDTD events. Declarations are assumed to belong to the internal DTD subset unless they appear between startEntity and endEntity events. Comments and processing instructions from the DTD should also be reported between the startDTD and endDTD events, in their original order of (logical) occurrence; they are not required to appear in their correct locations relative to DTDHandler or DeclHandler events, however.

Note that the start/endDTD events will appear within the start/endDocument events from ContentHandler and before the first startElement event.

Annotations
@Override
Exceptions
SAXException:
The application may raise an exception.
startElementback to summary
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException

Overrides org.xml.sax.helpers.DefaultHandler.startElement.

Implements org.xml.sax.ContentHandler.startElement.

Doc from org.xml.sax.helpers.DefaultHandler.startElement.

Receive notification of the start of an element.

By default, do nothing. Application writers may override this method in a subclass to take specific actions at the start of each element (such as allocating a new tree node or writing output to a file).

Annotations
@Override
Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
startEntityback to summary
public void startEntity(String name) throws SAXException

Implements org.xml.sax.ext.LexicalHandler.startEntity.

Doc from org.xml.sax.ext.LexicalHandler.startEntity.

Report the beginning of some internal and external XML entities.

The reporting of parameter entities (including the external DTD subset) is optional, and SAX2 drivers that report LexicalHandler events may not implement it; you can use the http://xml.org/sax/features/lexical-handler/parameter-entities feature to query or control the reporting of parameter entities.

General entities are reported with their regular names, parameter entities have '%' prepended to their names, and the external DTD subset has the pseudo-entity name "[dtd]".

When a SAX2 driver is providing these events, all other events must be properly nested within start/end entity events. There is no additional requirement that events from DeclHandler or DTDHandler be properly ordered.

Note that skipped entities will be reported through the skippedEntity event, which is part of the ContentHandler interface.

Because of the streaming event model that SAX uses, some entity boundaries cannot be reported under any circumstances:

  • general entities within attribute values
  • parameter entities within declarations

These will be silently expanded, with no indication of where the original entity boundaries were.

Note also that the boundaries of character references (which are not really entities anyway) are not reported.

All start/endEntity events must be properly nested.

Annotations
@Override
Exceptions
SAXException:
The application may raise an exception.
startPrefixMappingback to summary
public void startPrefixMapping(String prefix, String uri) throws SAXException

Overrides org.xml.sax.helpers.DefaultHandler.startPrefixMapping.

Implements org.xml.sax.ContentHandler.startPrefixMapping.

Doc from org.xml.sax.helpers.DefaultHandler.startPrefixMapping.

Receive notification of the start of a Namespace mapping.

By default, do nothing. Application writers may override this method in a subclass to take specific actions at the start of each Namespace prefix scope (such as storing the prefix mapping).

Annotations
@Override
Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.