Package org.apache.axis2.schema.writer
Class CStructWriter
java.lang.Object
org.apache.axis2.schema.writer.CStructWriter
- All Implemented Interfaces:
BeanWriter
Java Bean writer for the schema compiler.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected FilecreateOutFile(String fileName, String extension, String prefix) Creates the output fileKeep unimplementedThis returns a map of Qnames vs DOMDocument models.getPrefixForURI(String uri) Get a prefix for a namespace URI.getPrefixForURI(String uri, String defaultPrefix) Get a prefix for the given namespace URI.voidinit(CompilerOptions options) Initializes the writer with compiler options.makeFullyQualifiedClassName(QName qName) Make the fully qualified class name for an element or named typeprotected voidpopulateListInfo(BeanWriterMetaInfoHolder metainf, Document model, Element rootElement, Map<QName, String> typeMap, Map<QName, String> groupTypeMap) protected voidpopulateMemberInfo(BeanWriterMetaInfoHolder metainf, Document model, Element rootElement, Map<QName, String> typeMap) voidregisterExtensionMapperPackageName(String mapperPackageName) Keep unimplementedwrite(QName qName, Map<QName, String> typeMap, Map<QName, String> groupTypeMap, BeanWriterMetaInfoHolder metainf, boolean isAbstract) Write a complex typewrite(org.apache.ws.commons.schema.XmlSchemaElement element, Map<QName, String> typeMap, Map<QName, String> groupTypeMap, BeanWriterMetaInfoHolder metainf) Write a elementwrite(org.apache.ws.commons.schema.XmlSchemaSimpleType simpleType, Map<QName, String> typeMap, Map<QName, String> groupTypeMap, BeanWriterMetaInfoHolder metainf) Write a simple typevoidWrites a wrapped class.voidwriteExtensionMapper(BeanWriterMetaInfoHolder[] metainfArray) Generate the Extension Mapper module.
-
Field Details
-
WRAPPED_DATABINDING_CLASS_NAME
- See Also:
-
EXTENSION_MAPPER_CLASSNAME
- See Also:
-
AXIS2_PREFIX
- See Also:
-
rootDir
-
DEFAULT_CLASS_NAME
- See Also:
-
DEFAULT_CLASS_ARRAY_NAME
- See Also:
-
DEFAULT_ATTRIB_CLASS_NAME
- See Also:
-
DEFAULT_ATTRIB_ARRAY_CLASS_NAME
- See Also:
-
DEFAULT_TYPE_NS
- See Also:
-
-
Constructor Details
-
CStructWriter
public CStructWriter()Default constructor
-
-
Method Details
-
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:
getModelMapin interfaceBeanWriter- Returns:
- Returns Map.
- See Also:
-
getDefaultClassName
- Specified by:
getDefaultClassNamein interfaceBeanWriter
-
getDefaultClassArrayName
- Specified by:
getDefaultClassArrayNamein interfaceBeanWriter
-
getDefaultAttribClassName
- Specified by:
getDefaultAttribClassNamein interfaceBeanWriter
-
getDefaultAttribArrayClassName
- Specified by:
getDefaultAttribArrayClassNamein interfaceBeanWriter
-
init
Description copied from interface:BeanWriterInitializes the writer with compiler options.- Specified by:
initin interfaceBeanWriter- Throws:
SchemaCompilationException
-
write
public String write(org.apache.ws.commons.schema.XmlSchemaElement element, Map<QName, String> typeMap, Map<QName, throws SchemaCompilationExceptionString> groupTypeMap, BeanWriterMetaInfoHolder metainf) Description copied from interface:BeanWriterWrite a element- Specified by:
writein interfaceBeanWriter- Parameters:
element-typeMap-metainf-- Returns:
- Returns String.
- Throws:
SchemaCompilationException
-
write
public String write(QName qName, Map<QName, String> typeMap, Map<QName, throws SchemaCompilationExceptionString> groupTypeMap, BeanWriterMetaInfoHolder metainf, boolean isAbstract) Description copied from interface:BeanWriterWrite a complex type- Specified by:
writein interfaceBeanWriter- Parameters:
qName-typeMap-metainf-isAbstract-- Returns:
- Returns String.
- Throws:
SchemaCompilationException- See Also:
-
writeBatch
Description copied from interface:BeanWriterWrites a wrapped class. This will have effect only if the CompilerOptions wrapclassses returns true.- Specified by:
writeBatchin interfaceBeanWriter- Throws:
SchemaCompilationException- See Also:
-
write
public String write(org.apache.ws.commons.schema.XmlSchemaSimpleType simpleType, Map<QName, String> typeMap, Map<QName, throws SchemaCompilationExceptionString> groupTypeMap, BeanWriterMetaInfoHolder metainf) Description copied from interface:BeanWriterWrite a simple type- Specified by:
writein interfaceBeanWriter- Parameters:
simpleType-typeMap-metainf-- Returns:
- Returns String.
- Throws:
SchemaCompilationException
-
makeFullyQualifiedClassName
Make the fully qualified class name for an element or named type- Specified by:
makeFullyQualifiedClassNamein interfaceBeanWriter- 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
-
populateMemberInfo
-
createOutFile
Creates the output file- Parameters:
fileName-extension-- Throws:
Exception
-
getPrefixForURI
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
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
Keep unimplemented- Specified by:
registerExtensionMapperPackageNamein interfaceBeanWriter- Parameters:
mapperPackageName-- See Also:
-
writeExtensionMapper
public void writeExtensionMapper(BeanWriterMetaInfoHolder[] metainfArray) throws SchemaCompilationException Generate the Extension Mapper module. This provides pseudo-polymorphism support to the generated code, allowing to send and receive derived classes in requests/replies that expect a base class.- Specified by:
writeExtensionMapperin interfaceBeanWriter- Parameters:
metainfArray-- Throws:
SchemaCompilationException- See Also:
-
getExtensionMapperPackageName
Keep unimplemented- Specified by:
getExtensionMapperPackageNamein interfaceBeanWriter- See Also:
-