JBoss XML Binding 2.0.3.GA-redhat-2

org.jboss.xb.binding
Class ObjectModelBuilder

java.lang.Object
  extended by org.jboss.xb.binding.ObjectModelBuilder
All Implemented Interfaces:
JBossXBParser.ContentHandler, JBossXBParser.DtdAwareContentHandler, UnmarshallingContext

public class ObjectModelBuilder
extends Object
implements UnmarshallingContext, JBossXBParser.DtdAwareContentHandler

An instance of this class translates SAX events into org.jboss.xml.binding.GenericObjectModelFactory calls such as newChild, addChild and setValue. WARN: this implementation is not thread-safe!

Version:
$Revision: 3903 $
Author:
Alexey Loubyansky

Constructor Summary
ObjectModelBuilder()
           
 
Method Summary
 void characters(char[] ch, int start, int length)
           
 void endDTD()
           
 void endElement(String namespaceURI, String localName, String qName)
           
 void endPrefixMapping(String prefix)
           
 String getChildContent(String namespaceURI, String qName)
          Returns child's content.
 NamespaceContext getNamespaceContext()
           
 Iterator<String> getNamespaceURIs()
           
 Object getRoot()
           
 org.apache.xerces.xs.XSTypeDefinition getType()
           
 void init(ObjectModelFactory defaultFactory, Object root)
           
 boolean isTrimTextContent()
           
 void mapFactoryToNamespace(ObjectModelFactory factory, String namespaceUri)
           
 void popFactory()
           
 void processingInstruction(String target, String data)
           
 void pushFactory(String namespaceURI, String localName, GenericObjectModelFactory factory)
           
 QName resolveQName(String value)
          Construct a QName from a value
 void setTrimTextContent(boolean trimTextContent)
          Should the text content be automatically trimmed before setValue(...) is called.
 void startDTD(String name, String publicId, String systemId)
           
 void startElement(String namespaceURI, String localName, String qName, Attributes atts)
           
 void startPrefixMapping(String prefix, String uri)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectModelBuilder

public ObjectModelBuilder()
Method Detail

mapFactoryToNamespace

public void mapFactoryToNamespace(ObjectModelFactory factory,
                                  String namespaceUri)

init

public void init(ObjectModelFactory defaultFactory,
                 Object root)

pushFactory

public void pushFactory(String namespaceURI,
                        String localName,
                        GenericObjectModelFactory factory)

popFactory

public void popFactory()

getNamespaceURIs

public Iterator<String> getNamespaceURIs()
Specified by:
getNamespaceURIs in interface UnmarshallingContext
Returns:
all the known namespace URIs

getNamespaceContext

public NamespaceContext getNamespaceContext()
Specified by:
getNamespaceContext in interface UnmarshallingContext
Returns:
NamespaceContext instance

isTrimTextContent

public boolean isTrimTextContent()
Specified by:
isTrimTextContent in interface UnmarshallingContext
Returns:
true if the text content passed to the setValue(...) method is automatically trimmed (the default).

setTrimTextContent

public void setTrimTextContent(boolean trimTextContent)
Description copied from interface: UnmarshallingContext
Should the text content be automatically trimmed before setValue(...) is called.

Specified by:
setTrimTextContent in interface UnmarshallingContext

resolveQName

public QName resolveQName(String value)
Construct a QName from a value

Specified by:
resolveQName in interface UnmarshallingContext
Parameters:
value - A value that is of the form [prefix:]localpart

getChildContent

public String getChildContent(String namespaceURI,
                              String qName)
Description copied from interface: UnmarshallingContext
Returns child's content. todo consider deprecating this method

Specified by:
getChildContent in interface UnmarshallingContext
Returns:

getType

public org.apache.xerces.xs.XSTypeDefinition getType()
Specified by:
getType in interface UnmarshallingContext
Returns:
current element's type definition or null if this info is not available

startPrefixMapping

public void startPrefixMapping(String prefix,
                               String uri)
Specified by:
startPrefixMapping in interface JBossXBParser.ContentHandler

endPrefixMapping

public void endPrefixMapping(String prefix)
Specified by:
endPrefixMapping in interface JBossXBParser.ContentHandler

processingInstruction

public void processingInstruction(String target,
                                  String data)
Specified by:
processingInstruction in interface JBossXBParser.ContentHandler

getRoot

public Object getRoot()
Specified by:
getRoot in interface JBossXBParser.ContentHandler

startDTD

public void startDTD(String name,
                     String publicId,
                     String systemId)
Specified by:
startDTD in interface JBossXBParser.DtdAwareContentHandler

endDTD

public void endDTD()
Specified by:
endDTD in interface JBossXBParser.DtdAwareContentHandler

startElement

public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes atts)
Specified by:
startElement in interface JBossXBParser.ContentHandler

endElement

public void endElement(String namespaceURI,
                       String localName,
                       String qName)
Specified by:
endElement in interface JBossXBParser.ContentHandler

characters

public void characters(char[] ch,
                       int start,
                       int length)
Specified by:
characters in interface JBossXBParser.ContentHandler

JBoss XML Binding 2.0.3.GA-redhat-2

Copyright © 2012 JBoss by Red Hat. All Rights Reserved.