APIdia Launch Partner
Top Fields Constructors Methods
com.sun.xml.internal.stream.dtd

public Class DTDGrammarUtil

extends Object
Class Inheritance
Imports
com.sun.xml.internal.stream.dtd.nonvalidating.DTDGrammar, .XMLAttributeDecl, .XMLElementDecl, .XMLSimpleType, com.sun.org.apache.xerces.internal.impl.Constants, com.sun.org.apache.xerces.internal.util.SymbolTable, .XMLChar, .XMLSymbols, com.sun.org.apache.xerces.internal.xni.Augmentations, .QName, .NamespaceContext, .XMLAttributes, .XMLString, .XNIException, com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager, .XMLConfigurationException, javax.xml.XMLConstants

Field Summary

Modifier and TypeField and Description
private static final boolean
DEBUG_ATTRIBUTES

Compile to true to debug attributes.

private static final boolean
DEBUG_ELEMENT_CHILDREN

Compile to true to debug element children.

private StringBuilder
fBuffer

Temporary string buffers.

private int
fCurrentContentSpecType

Current content spec type.

private int
fCurrentElementIndex

Current element index.

protected DTDGrammar
private boolean[]
fElementContentState

Content spec type stack.

private int
fElementDepth

Element depth.

private boolean
fInElementContent

True if inside of element content.

private NamespaceContext
protected boolean
fNamespaces

Namespaces.

protected SymbolTable
fSymbolTable

Symbol table.

private XMLAttributeDecl
fTempAttDecl

Temporary attribute declaration.

private QName
fTempQName

Temporary qualified name.

protected static final String
protected static final String
SYMBOL_TABLE

Property identifier: symbol table.

Constructor Summary

AccessConstructor and Description
public
DTDGrammarUtil(SymbolTable symbolTable)

Default constructor.

public
DTDGrammarUtil(DTDGrammar grammar, SymbolTable symbolTable)

public
DTDGrammarUtil(DTDGrammar grammar, SymbolTable symbolTable, NamespaceContext namespaceContext)

Method Summary

Modifier and TypeMethod and Description
public void
addDTDDefaultAttrs(QName elementName, XMLAttributes attributes)

Add default attributes and validate.

public void
endCDATA(Augmentations
Additional information that may include infoset augmentations
augs
)

The end of a CDATA section.

public void
endElement(QName
The name of the element.
element
)

The end of an element.

private void
ensureStackCapacity(int newElementDepth)

ensure element stack capacity

private String
getAttributeTypeName(XMLAttributeDecl attrDecl)

convert attribute type from ints to strings

protected void
handleEndElement(QName element)

Handle end element.

protected void

Returns:

true if validator is removed from the pipeline
handleStartElement
(QName element, XMLAttributes attributes)

Handle element

public boolean
public boolean
private boolean
normalizeAttrValue(XMLAttributes
The list of attributes
attributes
,
int
The index of the attribute to normalize
index
)

Normalize the attribute value of a non CDATA attributes collapsing sequences of space characters (x20)

public void
reset(XMLComponentManager componentManager)

public void
startCDATA(Augmentations
Additional information that may include infoset augmentations
augs
)

The start of a CDATA section.

public void
startElement(QName
The name of the element.
element
,
XMLAttributes
The element attributes.
attributes
)

The start of an element.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEBUG_ATTRIBUTESback to summary
private static final boolean DEBUG_ATTRIBUTES

Compile to true to debug attributes.

DEBUG_ELEMENT_CHILDRENback to summary
private static final boolean DEBUG_ELEMENT_CHILDREN

Compile to true to debug element children.

fBufferback to summary
private StringBuilder fBuffer

Temporary string buffers.

fCurrentContentSpecTypeback to summary
private int fCurrentContentSpecType

Current content spec type.

fCurrentElementIndexback to summary
private int fCurrentElementIndex

Current element index.

fDTDGrammarback to summary
protected DTDGrammar fDTDGrammar
fElementContentStateback to summary
private boolean[] fElementContentState

Content spec type stack.

fElementDepthback to summary
private int fElementDepth

Element depth.

fInElementContentback to summary
private boolean fInElementContent

True if inside of element content.

fNamespaceContextback to summary
private NamespaceContext fNamespaceContext
fNamespacesback to summary
protected boolean fNamespaces

Namespaces.

fSymbolTableback to summary
protected SymbolTable fSymbolTable

Symbol table.

fTempAttDeclback to summary
private XMLAttributeDecl fTempAttDecl

Temporary attribute declaration.

fTempQNameback to summary
private QName fTempQName

Temporary qualified name.

NAMESPACESback to summary
protected static final String NAMESPACES
SYMBOL_TABLEback to summary
protected static final String SYMBOL_TABLE

Property identifier: symbol table.

Constructor Detail

DTDGrammarUtilback to summary
public DTDGrammarUtil(SymbolTable symbolTable)

Default constructor.

DTDGrammarUtilback to summary
public DTDGrammarUtil(DTDGrammar grammar, SymbolTable symbolTable)
DTDGrammarUtilback to summary
public DTDGrammarUtil(DTDGrammar grammar, SymbolTable symbolTable, NamespaceContext namespaceContext)

Method Detail

addDTDDefaultAttrsback to summary
public void addDTDDefaultAttrs(QName elementName, XMLAttributes attributes) throws XNIException

Add default attributes and validate.

endCDATAback to summary
public void endCDATA(Augmentations augs) throws XNIException

The end of a CDATA section.

Parameters
augs:Augmentations

Additional information that may include infoset augmentations

Exceptions
XNIException:
Thrown by handler to signal an error.
endElementback to summary
public void endElement(QName element) throws XNIException

The end of an element.

Parameters
element:QName

The name of the element.

Exceptions
XNIException:
Thrown by handler to signal an error.
ensureStackCapacityback to summary
private void ensureStackCapacity(int newElementDepth)

ensure element stack capacity

getAttributeTypeNameback to summary
private String getAttributeTypeName(XMLAttributeDecl attrDecl)

convert attribute type from ints to strings

handleEndElementback to summary
protected void handleEndElement(QName element) throws XNIException

Handle end element.

handleStartElementback to summary
protected void handleStartElement(QName element, XMLAttributes attributes) throws XNIException

Handle element

Returns:void

true if validator is removed from the pipeline

isIgnorableWhiteSpaceback to summary
public boolean isIgnorableWhiteSpace(XMLString text)
isInElementContentback to summary
public boolean isInElementContent()
normalizeAttrValueback to summary
private boolean normalizeAttrValue(XMLAttributes attributes, int index)

Normalize the attribute value of a non CDATA attributes collapsing sequences of space characters (x20)

Parameters
attributes:XMLAttributes

The list of attributes

index:int

The index of the attribute to normalize

resetback to summary
public void reset(XMLComponentManager componentManager) throws XMLConfigurationException
startCDATAback to summary
public void startCDATA(Augmentations augs) throws XNIException

The start of a CDATA section.

Parameters
augs:Augmentations

Additional information that may include infoset augmentations

Exceptions
XNIException:
Thrown by handler to signal an error.
startElementback to summary
public void startElement(QName element, XMLAttributes attributes) throws XNIException

The start of an element.

Parameters
element:QName

The name of the element.

attributes:XMLAttributes

The element attributes.

Exceptions
XNIException:
Thrown by handler to signal an error.