org.apache.axis2.schema.writer
Class CStructWriter

java.lang.Object
  extended by org.apache.axis2.schema.writer.CStructWriter
All Implemented Interfaces:
BeanWriter

public class CStructWriter
extends java.lang.Object
implements BeanWriter

Java Bean writer for the schema compiler.


Field Summary
static java.lang.String AXIS2_PREFIX
           
static java.lang.String DEFAULT_ATTRIB_ARRAY_CLASS_NAME
           
static java.lang.String DEFAULT_ATTRIB_CLASS_NAME
           
static java.lang.String DEFAULT_CLASS_ARRAY_NAME
           
static java.lang.String DEFAULT_CLASS_NAME
           
static java.lang.String DEFAULT_TYPE_NS
           
protected  java.io.File rootDir
           
static java.lang.String WRAPPED_DATABINDING_CLASS_NAME
           
 
Constructor Summary
CStructWriter()
          Default constructor
 
Method Summary
protected  java.io.File createOutFile(java.lang.String fileName, java.lang.String extension)
          Creates the output file
 java.lang.String getDefaultAttribArrayClassName()
           
 java.lang.String getDefaultAttribClassName()
           
 java.lang.String getDefaultClassArrayName()
           
 java.lang.String getDefaultClassName()
           
 java.lang.String getExtensionMapperPackageName()
          Keep unimplemented
 java.util.Map getModelMap()
          This returns a map of Qnames vs DOMDocument models.
 java.lang.String getPrefixForURI(java.lang.String uri)
          Get a prefix for a namespace URI.
 java.lang.String getPrefixForURI(java.lang.String uri, java.lang.String defaultPrefix)
          Get a prefix for the given namespace URI.
 void init(CompilerOptions options)
          Initializes the writer with compiler options.
 java.lang.String makeFullyQualifiedClassName(QName qName)
          Make the fully qualified class name for an element or named type
protected  void populateListInfo(BeanWriterMetaInfoHolder metainf, org.w3c.dom.Document model, org.w3c.dom.Element rootElement, java.util.Map typeMap, java.util.Map groupTypeMap)
           
protected  void populateMemberInfo(BeanWriterMetaInfoHolder metainf, org.w3c.dom.Document model, org.w3c.dom.Element rootElement, java.util.Map typeMap)
           
 void registerExtensionMapperPackageName(java.lang.String mapperPackageName)
          Keep unimplemented
 java.lang.String write(QName qName, java.util.Map typeMap, java.util.Map groupTypeMap, BeanWriterMetaInfoHolder metainf, boolean isAbstract)
          Write a complex type
 java.lang.String write(org.apache.ws.commons.schema.XmlSchemaElement element, java.util.Map typeMap, java.util.Map groupTypeMap, BeanWriterMetaInfoHolder metainf)
          Write a element
 java.lang.String write(org.apache.ws.commons.schema.XmlSchemaSimpleType simpleType, java.util.Map typeMap, java.util.Map groupTypeMap, BeanWriterMetaInfoHolder metainf)
          Write a simple type
 void writeBatch()
          Writes a wrapped class.
 void writeExtensionMapper(BeanWriterMetaInfoHolder[] metainfArray)
          Keep unimplemented
 
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 java.lang.String WRAPPED_DATABINDING_CLASS_NAME
See Also:
Constant Field Values

AXIS2_PREFIX

public static final java.lang.String AXIS2_PREFIX
See Also:
Constant Field Values

rootDir

protected java.io.File rootDir

DEFAULT_CLASS_NAME

public static final java.lang.String DEFAULT_CLASS_NAME
See Also:
Constant Field Values

DEFAULT_CLASS_ARRAY_NAME

public static final java.lang.String DEFAULT_CLASS_ARRAY_NAME
See Also:
Constant Field Values

DEFAULT_ATTRIB_CLASS_NAME

public static final java.lang.String DEFAULT_ATTRIB_CLASS_NAME
See Also:
Constant Field Values

DEFAULT_ATTRIB_ARRAY_CLASS_NAME

public static final java.lang.String DEFAULT_ATTRIB_ARRAY_CLASS_NAME
See Also:
Constant Field Values

DEFAULT_TYPE_NS

public static final java.lang.String DEFAULT_TYPE_NS
See Also:
Constant Field Values
Constructor Detail

CStructWriter

public CStructWriter()
Default constructor

Method Detail

getModelMap

public java.util.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.
See Also:
BeanWriter.getModelMap()

getDefaultClassName

public java.lang.String getDefaultClassName()
Specified by:
getDefaultClassName in interface BeanWriter

getDefaultClassArrayName

public java.lang.String getDefaultClassArrayName()
Specified by:
getDefaultClassArrayName in interface BeanWriter

getDefaultAttribClassName

public java.lang.String getDefaultAttribClassName()
Specified by:
getDefaultAttribClassName in interface BeanWriter

getDefaultAttribArrayClassName

public java.lang.String getDefaultAttribArrayClassName()
Specified by:
getDefaultAttribArrayClassName in interface BeanWriter

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
Throws:
SchemaCompilationException

write

public java.lang.String write(org.apache.ws.commons.schema.XmlSchemaElement element,
                              java.util.Map typeMap,
                              java.util.Map groupTypeMap,
                              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 java.lang.String write(QName qName,
                              java.util.Map typeMap,
                              java.util.Map groupTypeMap,
                              BeanWriterMetaInfoHolder metainf,
                              boolean isAbstract)
                       throws SchemaCompilationException
Description copied from interface: BeanWriter
Write a complex type

Specified by:
write in interface BeanWriter
Parameters:
qName -
typeMap -
metainf -
isAbstract -
Returns:
Returns String.
Throws:
SchemaCompilationException
See Also:
BeanWriter

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:
SchemaCompilationException
See Also:
BeanWriter.writeBatch()

write

public java.lang.String write(org.apache.ws.commons.schema.XmlSchemaSimpleType simpleType,
                              java.util.Map typeMap,
                              java.util.Map groupTypeMap,
                              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)

makeFullyQualifiedClassName

public java.lang.String makeFullyQualifiedClassName(QName qName)
Make the fully qualified class name for an element or named type

Specified by:
makeFullyQualifiedClassName in interface BeanWriter
Parameters:
qName - the qualified Name for this element or type in the schema
Returns:
the appropriate fully qualified class name to use in generated code

populateListInfo

protected void populateListInfo(BeanWriterMetaInfoHolder metainf,
                                org.w3c.dom.Document model,
                                org.w3c.dom.Element rootElement,
                                java.util.Map typeMap,
                                java.util.Map groupTypeMap)

populateMemberInfo

protected void populateMemberInfo(BeanWriterMetaInfoHolder metainf,
                                  org.w3c.dom.Document model,
                                  org.w3c.dom.Element rootElement,
                                  java.util.Map typeMap)

createOutFile

protected java.io.File createOutFile(java.lang.String fileName,
                                     java.lang.String extension)
                              throws java.lang.Exception
Creates the output file

Parameters:
fileName -
extension -
Throws:
java.lang.Exception

getPrefixForURI

public java.lang.String getPrefixForURI(java.lang.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 java.lang.String getPrefixForURI(java.lang.String uri,
                                        java.lang.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"


registerExtensionMapperPackageName

public void registerExtensionMapperPackageName(java.lang.String mapperPackageName)
Keep unimplemented

Specified by:
registerExtensionMapperPackageName in interface BeanWriter
Parameters:
mapperPackageName -
See Also:
BeanWriter.registerExtensionMapperPackageName(String)

writeExtensionMapper

public void writeExtensionMapper(BeanWriterMetaInfoHolder[] metainfArray)
                          throws SchemaCompilationException
Keep unimplemented

Specified by:
writeExtensionMapper in interface BeanWriter
Parameters:
metainfArray -
Throws:
SchemaCompilationException
See Also:
BeanWriter.writeExtensionMapper(org.apache.axis2.schema.BeanWriterMetaInfoHolder[])

getExtensionMapperPackageName

public java.lang.String getExtensionMapperPackageName()
Keep unimplemented

Specified by:
getExtensionMapperPackageName in interface BeanWriter
See Also:
BeanWriter.getExtensionMapperPackageName()


Copyright © 2007 Apache Web Services Project. All Rights Reserved.