Top Description Inners Fields Constructors Methods
org.glassfish.jaxb.runtime.v2.runtime.unmarshaller

public final Class InterningXmlVisitor

extends Object
implements XmlVisitor
Class Inheritance
All Implemented Interfaces
org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor
Imports
org.glassfish.jaxb.core.v2.runtime.unmarshaller.LocatorEx, org.xml.sax.Attributes, .SAXException, javax.xml.namespace.NamespaceContext

XmlVisitor decorator that interns all string tokens.
Author
Kohsuke Kawaguchi

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final InterningXmlVisitor.AttributesImpl
private final XmlVisitor

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
public void
endPrefixMapping(String prefix)

Implements org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.endPrefixMapping.

Called after endElement event to notify the end of a binding.

public UnmarshallingContext
public XmlVisitor.TextPredictor
getPredictor()

Implements org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.getPredictor.

Gets the predictor that can be used for the caller to avoid calling text(CharSequence) unnecessarily.

private static String
public void
public void
startElement(TagName tagName)

Implements org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.startElement.

Notifies a start tag of a new element.

public void
startPrefixMapping(String prefix, String nsUri)

Implements org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.startPrefixMapping.

Called before startElement event to notify a new namespace binding.

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

attributesback to summary
private final InterningXmlVisitor.AttributesImpl attributes
nextback to summary
private final XmlVisitor next

Constructor Detail

InterningXmlVisitorback to summary
public InterningXmlVisitor(XmlVisitor next)

Method Detail

endDocumentback to summary
public void endDocument() throws SAXException

Implements org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.endDocument.

Annotations
@Override
endElementback to summary
public void endElement(TagName tagName) throws SAXException

Implements org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.endElement.

Annotations
@Override
endPrefixMappingback to summary
public void endPrefixMapping(String prefix) throws SAXException

Implements org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.endPrefixMapping.

Doc from org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.endPrefixMapping.

Called after endElement event to notify the end of a binding.

Annotations
@Override
getContextback to summary
public UnmarshallingContext getContext()

Implements org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.getContext.

Doc from org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.getContext.

Returns the UnmarshallingContext at the end of the chain.

Annotations
@Override
getPredictorback to summary
public XmlVisitor.TextPredictor getPredictor()

Implements org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.getPredictor.

Doc from org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.getPredictor.

Gets the predictor that can be used for the caller to avoid calling text(CharSequence) unnecessarily.

Annotations
@Override
internback to summary
private static String intern(String s)
startDocumentback to summary
public void startDocument(LocatorEx locator, NamespaceContext nsContext) throws SAXException

Implements org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.startDocument.

Doc from org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.startDocument.

Notifies a start of the document.

Annotations
@Override
startElementback to summary
public void startElement(TagName tagName) throws SAXException

Implements org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.startElement.

Doc from org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.startElement.

Notifies a start tag of a new element. namespace URIs and local names must be interned.

Annotations
@Override
startPrefixMappingback to summary
public void startPrefixMapping(String prefix, String nsUri) throws SAXException

Implements org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.startPrefixMapping.

Doc from org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.startPrefixMapping.

Called before startElement event to notify a new namespace binding.

Annotations
@Override
textback to summary
public void text(CharSequence pcdata) throws SAXException

Implements org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.text.

Doc from org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.XmlVisitor.text.

Text events.

The caller should consult TextPredictor to see if the unmarshaller is expecting any PCDATA. If the above is returning false, the caller is OK to skip any text in XML. The net effect is that we can ignore whitespaces quickly.

Annotations
@Override
org.glassfish.jaxb.runtime.v2.runtime.unmarshaller back to summary

private Class InterningXmlVisitor.AttributesImpl

extends Object
implements Attributes
Class Inheritance
  • java.lang.Object
  • org.glassfish.jaxb.runtime.v2.runtime.unmarshaller.InterningXmlVisitor.AttributesImpl
All Implemented Interfaces
org.xml.sax.Attributes

Field Summary

Modifier and TypeField and Description
private Attributes

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public int
getIndex(String qName)

Implements org.xml.sax.Attributes.getIndex.

Look up the index of an attribute by XML qualified (prefixed) name.

public int
getIndex(String uri, String localName)

Implements org.xml.sax.Attributes.getIndex.

Look up the index of an attribute by Namespace name.

public int
getLength()

Implements org.xml.sax.Attributes.getLength.

Return the number of attributes in the list.

public String
getLocalName(int index)

Implements org.xml.sax.Attributes.getLocalName.

Look up an attribute's local name by index.

public String
getQName(int index)

Implements org.xml.sax.Attributes.getQName.

Look up an attribute's XML qualified (prefixed) name by index.

public String
getType(int index)

Implements org.xml.sax.Attributes.getType.

Look up an attribute's type by index.

public String
getType(String qName)

Implements org.xml.sax.Attributes.getType.

Look up an attribute's type by XML qualified (prefixed) name.

public String
getType(String uri, String localName)

Implements org.xml.sax.Attributes.getType.

Look up an attribute's type by Namespace name.

public String
getURI(int index)

Implements org.xml.sax.Attributes.getURI.

Look up an attribute's Namespace URI by index.

public String
getValue(int index)

Implements org.xml.sax.Attributes.getValue.

Look up an attribute's value by index.

public String
getValue(String qName)

Implements org.xml.sax.Attributes.getValue.

Look up an attribute's value by XML qualified (prefixed) name.

public String
getValue(String uri, String localName)

Implements org.xml.sax.Attributes.getValue.

Look up an attribute's value by Namespace name.

pack-priv void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

coreback to summary
private Attributes core

Constructor Detail

AttributesImplback to summary
private AttributesImpl()

Method Detail

getIndexback to summary
public int getIndex(String qName)

Implements org.xml.sax.Attributes.getIndex.

Doc from org.xml.sax.Attributes.getIndex.

Look up the index of an attribute by XML qualified (prefixed) name.

Annotations
@Override
getIndexback to summary
public int getIndex(String uri, String localName)

Implements org.xml.sax.Attributes.getIndex.

Doc from org.xml.sax.Attributes.getIndex.

Look up the index of an attribute by Namespace name.

Annotations
@Override
getLengthback to summary
public int getLength()

Implements org.xml.sax.Attributes.getLength.

Doc from org.xml.sax.Attributes.getLength.

Return the number of attributes in the list.

Once you know the number of attributes, you can iterate through the list.

Annotations
@Override
getLocalNameback to summary
public String getLocalName(int index)

Implements org.xml.sax.Attributes.getLocalName.

Doc from org.xml.sax.Attributes.getLocalName.

Look up an attribute's local name by index.

Annotations
@Override
getQNameback to summary
public String getQName(int index)

Implements org.xml.sax.Attributes.getQName.

Doc from org.xml.sax.Attributes.getQName.

Look up an attribute's XML qualified (prefixed) name by index.

Annotations
@Override
getTypeback to summary
public String getType(int index)

Implements org.xml.sax.Attributes.getType.

Doc from org.xml.sax.Attributes.getType.

Look up an attribute's type by index.

The attribute type is one of the strings "CDATA", "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES", or "NOTATION" (always in upper case).

If the parser has not read a declaration for the attribute, or if the parser does not report attribute types, then it must return the value "CDATA" as stated in the XML 1.0 Recommendation (clause 3.3.3, "Attribute-Value Normalization").

For an enumerated attribute that is not a notation, the parser will report the type as "NMTOKEN".

Annotations
@Override
getTypeback to summary
public String getType(String qName)

Implements org.xml.sax.Attributes.getType.

Doc from org.xml.sax.Attributes.getType.

Look up an attribute's type by XML qualified (prefixed) name.

See getType(int) for a description of the possible types.

Annotations
@Override
getTypeback to summary
public String getType(String uri, String localName)

Implements org.xml.sax.Attributes.getType.

Doc from org.xml.sax.Attributes.getType.

Look up an attribute's type by Namespace name.

See getType(int) for a description of the possible types.

Annotations
@Override
getURIback to summary
public String getURI(int index)

Implements org.xml.sax.Attributes.getURI.

Doc from org.xml.sax.Attributes.getURI.

Look up an attribute's Namespace URI by index.

Annotations
@Override
getValueback to summary
public String getValue(int index)

Implements org.xml.sax.Attributes.getValue.

Doc from org.xml.sax.Attributes.getValue.

Look up an attribute's value by index.

If the attribute value is a list of tokens (IDREFS, ENTITIES, or NMTOKENS), the tokens will be concatenated into a single string with each token separated by a single space.

Annotations
@Override
getValueback to summary
public String getValue(String qName)

Implements org.xml.sax.Attributes.getValue.

Doc from org.xml.sax.Attributes.getValue.

Look up an attribute's value by XML qualified (prefixed) name.

See getValue(int) for a description of the possible values.

Annotations
@Override
getValueback to summary
public String getValue(String uri, String localName)

Implements org.xml.sax.Attributes.getValue.

Doc from org.xml.sax.Attributes.getValue.

Look up an attribute's value by Namespace name.

See getValue(int) for a description of the possible values.

Annotations
@Override
setAttributesback to summary
pack-priv void setAttributes(Attributes att)