com.sun.tools.xjc.api.impl.j2s
Class JAXBModelImpl

java.lang.Object
  extended by com.sun.tools.xjc.api.impl.j2s.JAXBModelImpl
All Implemented Interfaces:
J2SJAXBModel, JAXBModel

final class JAXBModelImpl
extends java.lang.Object
implements J2SJAXBModel


Constructor Summary
JAXBModelImpl(com.sun.xml.bind.v2.model.core.TypeInfoSet<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration> types, com.sun.xml.bind.v2.model.annotation.AnnotationReader<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration> reader, java.util.Collection<Reference> rootClasses, java.util.Map<javax.xml.namespace.QName,Reference> additionalElementDecls)
           
 
Method Summary
 void generateSchema(javax.xml.bind.SchemaOutputResolver outputResolver, ErrorListener errorListener)
          Generates the schema documents from the model.
 java.util.List<java.lang.String> getClassList()
          Returns a list of fully-qualified class names, which should be used at the runtime to create a new JAXBContext.
 javax.xml.namespace.QName getXmlTypeName(Reference javaType)
          Returns the name of the XML Type bound to the specified Java type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JAXBModelImpl

public JAXBModelImpl(com.sun.xml.bind.v2.model.core.TypeInfoSet<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration> types,
                     com.sun.xml.bind.v2.model.annotation.AnnotationReader<com.sun.mirror.type.TypeMirror,com.sun.mirror.declaration.TypeDeclaration,com.sun.mirror.declaration.FieldDeclaration,com.sun.mirror.declaration.MethodDeclaration> reader,
                     java.util.Collection<Reference> rootClasses,
                     java.util.Map<javax.xml.namespace.QName,Reference> additionalElementDecls)
Method Detail

getClassList

public java.util.List<java.lang.String> getClassList()
Description copied from interface: JAXBModel
Returns a list of fully-qualified class names, which should be used at the runtime to create a new JAXBContext.

Until the JAXB team fixes the bootstrapping issue, we have two bootstrapping methods. This one is to use a list of class names to call JAXBContext.newInstance(Class[]) method. If this method returns non-null, the caller is expected to use that method. This is meant to be a temporary workaround.

Specified by:
getClassList in interface JAXBModel
Returns:
non-null read-only list.

getXmlTypeName

public javax.xml.namespace.QName getXmlTypeName(Reference javaType)
Description copied from interface: J2SJAXBModel
Returns the name of the XML Type bound to the specified Java type.

Specified by:
getXmlTypeName in interface J2SJAXBModel
Parameters:
javaType - must not be null. This must be one of the References specified in the JavaCompiler.bind(java.util.Collection, java.util.Map, java.lang.String, com.sun.mirror.apt.AnnotationProcessorEnvironment) method.
Returns:
null if it is not a part of the input to JavaCompiler.bind(java.util.Collection, java.util.Map, java.lang.String, com.sun.mirror.apt.AnnotationProcessorEnvironment).

generateSchema

public void generateSchema(javax.xml.bind.SchemaOutputResolver outputResolver,
                           ErrorListener errorListener)
                    throws java.io.IOException
Description copied from interface: J2SJAXBModel
Generates the schema documents from the model.

The caller can use the additionalElementDecls parameter to add element declarations to the generate schema. For example, if the JAX-RPC passes in the following entry: {foo}bar -> DeclaredType for java.lang.String then JAXB generates the following element declaration (in the schema document for the namespace "foo")" <xs:element name="bar" type="xs:string" /> This can be used for generating schema components necessary for WSDL.

Specified by:
generateSchema in interface J2SJAXBModel
Parameters:
outputResolver - this object controls the output to which schemas will be sent.
Throws:
java.io.IOException - if SchemaOutputResolver throws an IOException.