org.apache.axis2.schema.writer
Class JavaBeanWriter

java.lang.Object
  extended byorg.apache.axis2.schema.writer.JavaBeanWriter
All Implemented Interfaces:
BeanWriter

public class JavaBeanWriter
extends Object
implements BeanWriter

Java Bean writer for the schema compiler.


Field Summary
static String WRAPPED_DATABINDING_CLASS_NAME
           
 
Constructor Summary
JavaBeanWriter()
          Default constructor
 
Method Summary
 Map getModelMap()
          This returns a map of Qnames vs DOMDocument models.
 String getPrefixForURI(String uri)
          Get a prefix for a namespace URI.
 String getPrefixForURI(String uri, String defaultPrefix)
          Get a prefix for the given namespace URI.
 void init(CompilerOptions options)
          Initializes the writer with compiler options.
 String write(org.apache.ws.commons.schema.XmlSchemaComplexType complexType, Map typeMap, BeanWriterMetaInfoHolder metainf)
          Write a complex type
 String write(org.apache.ws.commons.schema.XmlSchemaElement element, Map typeMap, BeanWriterMetaInfoHolder metainf)
          Write a element
 String write(org.apache.ws.commons.schema.XmlSchemaSimpleType simpleType, Map typeMap, BeanWriterMetaInfoHolder metainf)
          Write a simple type
 void writeBatch()
          Writes a wrapped class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WRAPPED_DATABINDING_CLASS_NAME

public static final String WRAPPED_DATABINDING_CLASS_NAME
See Also:
Constant Field Values
Constructor Detail

JavaBeanWriter

public JavaBeanWriter()
Default constructor

Method Detail

getModelMap

public Map getModelMap()
This returns a map of Qnames vs DOMDocument models. One can use this method to obtain the raw DOMmodels used to write the classes. This has no meaning when the classes are supposed to be wrapped so the

Specified by:
getModelMap in interface BeanWriter
Returns:
Returns Map.
Throws:
SchemaCompilationException
See Also:
BeanWriter.getModelMap()

init

public void init(CompilerOptions options)
          throws SchemaCompilationException
Description copied from interface: BeanWriter
Initializes the writer with compiler options.

Specified by:
init in interface BeanWriter
Parameters:
options -
Throws:
SchemaCompilationException

write

public String write(org.apache.ws.commons.schema.XmlSchemaElement element,
                    Map typeMap,
                    BeanWriterMetaInfoHolder metainf)
             throws SchemaCompilationException
Description copied from interface: BeanWriter
Write a element

Specified by:
write in interface BeanWriter
Parameters:
element -
typeMap -
metainf -
Returns:
Returns String.
Throws:
SchemaCompilationException

write

public String write(org.apache.ws.commons.schema.XmlSchemaComplexType complexType,
                    Map typeMap,
                    BeanWriterMetaInfoHolder metainf)
             throws SchemaCompilationException
Description copied from interface: BeanWriter
Write a complex type

Specified by:
write in interface BeanWriter
Parameters:
complexType -
typeMap -
metainf -
Returns:
Returns String.
Throws:
SchemaCompilationException
See Also:
BeanWriter.write(org.apache.ws.commons.schema.XmlSchemaComplexType, java.util.Map, org.apache.axis2.schema.BeanWriterMetaInfoHolder)

writeBatch

public void writeBatch()
                throws SchemaCompilationException
Description copied from interface: BeanWriter
Writes a wrapped class. This will have effect only if the CompilerOptions wrapclassses returns true.

Specified by:
writeBatch in interface BeanWriter
Throws:
Exception
SchemaCompilationException
See Also:
BeanWriter.writeBatch()

write

public String write(org.apache.ws.commons.schema.XmlSchemaSimpleType simpleType,
                    Map typeMap,
                    BeanWriterMetaInfoHolder metainf)
             throws SchemaCompilationException
Description copied from interface: BeanWriter
Write a simple type

Specified by:
write in interface BeanWriter
Parameters:
simpleType -
typeMap -
metainf -
Returns:
Returns String.
Throws:
SchemaCompilationException
See Also:
BeanWriter.write(org.apache.ws.commons.schema.XmlSchemaSimpleType, java.util.Map, org.apache.axis2.schema.BeanWriterMetaInfoHolder)

getPrefixForURI

public String getPrefixForURI(String uri)
Get a prefix for a namespace URI. This method will ALWAYS return a valid prefix - if the given URI is already mapped in this serialization, we return the previous prefix. If it is not mapped, we will add a new mapping and return a generated prefix of the form "ns".

Parameters:
uri - is the namespace uri
Returns:
Returns prefix.

getPrefixForURI

public String getPrefixForURI(String uri,
                              String defaultPrefix)
Get a prefix for the given namespace URI. If one has already been defined in this serialization, use that. Otherwise, map the passed default prefix to the URI, and return that. If a null default prefix is passed, use one of the form "ns"