Package org.apache.axis.wsdl.toJava
Class JavaBeanWriter
- java.lang.Object
-
- org.apache.axis.wsdl.toJava.JavaWriter
-
- org.apache.axis.wsdl.toJava.JavaClassWriter
-
- org.apache.axis.wsdl.toJava.JavaBeanWriter
-
- All Implemented Interfaces:
Generator
- Direct Known Subclasses:
JavaBeanFaultWriter
public class JavaBeanWriter extends JavaClassWriter
This is Wsdl2java's Complex Type Writer. It writes the.java file.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
enableDefaultConstructor
Field enableDefaultConstructorprotected boolean
enableEquals
Field enableEqualsprotected boolean
enableFullConstructor
Field enableFullConstructorprotected boolean
enableGetters
Field enableGettersprotected boolean
enableHashCode
Field enableHashCodeprotected boolean
enableMemberFields
Field enableMemberFieldsprotected boolean
enableSetters
Field enableSettersprotected boolean
enableSimpleConstructors
Field enableSimpleConstructorsprotected boolean
enableToString
Field enableToStringprotected java.util.Set
enumerationTypes
Field enumerationTypesprotected JavaBeanHelperWriter
helper
Field helperprotected boolean
isAny
Field isAnyprotected boolean
isMixed
Field isMixedprotected java.util.Vector
names
Field namesprotected boolean
parentIsAny
Field parentIsAnyprotected boolean
parentIsMixed
Field parentIsMixedprotected java.io.PrintWriter
pw
Field pwprotected java.util.ArrayList
simpleValueTypes
Field simpleValueTypes-
Fields inherited from class org.apache.axis.wsdl.toJava.JavaClassWriter
className, namespaces, packageName
-
Fields inherited from class org.apache.axis.wsdl.toJava.JavaWriter
emitter, LINE_LENGTH
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
JavaBeanWriter(Emitter emitter, TypeEntry type, java.util.Vector elements, TypeEntry extendType, java.util.Vector attributes, JavaWriter helper)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
generate()
Generate a java source file and/or helper source file.protected java.lang.String
getBinaryTypeEncoderName(java.lang.String elementName)
Returns the class name that should be used to serialize and deserialize this binary elementprotected java.lang.String
getClassModifiers()
Returns the appropriate extends textprotected TypeEntry
getElementDecl(java.lang.String elementName)
Returns the TypeEntry of the given elementprotected java.lang.String
getExtendsText()
Returns the appropriate extends textprotected java.lang.String
getImplementsText()
Returns the appropriate implements textprotected void
preprocess()
Builds the names String vector.protected void
writeAccessMethods()
Writes the setter and getter methodsprotected void
writeDefaultConstructor()
Writes the default constructor.protected void
writeEqualsMethod()
Writes a general purpose equals methodprotected void
writeFileBody(java.io.PrintWriter pw)
Generate the binding for the given complex type.protected void
writeFileHeader(java.io.PrintWriter pw)
Write a common header, including the package name, the class declaration, and the opening curly brace.protected void
writeFullConstructor()
Writes the full constructor.protected void
writeHashCodeMethod()
Writes a general purpose hashCode method.protected void
writeMemberFields()
Writes the member fields.protected void
writeMinimalConstructor()
protected void
writeSimpleConstructors()
Writes the constructors for SimpleTypes.protected void
writeSimpleTypeGetter(java.lang.String simpleValueType, java.lang.String name, java.lang.String returnString)
Method writeSimpleTypeGetterprotected void
writeSimpleTypeSetter(java.lang.String simpleValueType)
Method writeSimpleTypeSetterprotected void
writeToStringMethod()
Writes the toString method Currently the toString method is only written for simpleTypes.-
Methods inherited from class org.apache.axis.wsdl.toJava.JavaClassWriter
getClassName, getClassText, getFileName, getPackage, registerFile, writeFileFooter, writeHeaderComments, writePackage
-
Methods inherited from class org.apache.axis.wsdl.toJava.JavaWriter
closePrintWriter, getJavadocDescriptionPart, getPrintWriter, isFileGenerated, verboseMessage, writeComment, writeComment
-
-
-
-
Field Detail
-
helper
protected JavaBeanHelperWriter helper
Field helper
-
names
protected java.util.Vector names
Field names
-
simpleValueTypes
protected java.util.ArrayList simpleValueTypes
Field simpleValueTypes
-
enumerationTypes
protected java.util.Set enumerationTypes
Field enumerationTypes
-
pw
protected java.io.PrintWriter pw
Field pw
-
enableDefaultConstructor
protected boolean enableDefaultConstructor
Field enableDefaultConstructor
-
enableFullConstructor
protected boolean enableFullConstructor
Field enableFullConstructor
-
enableSimpleConstructors
protected boolean enableSimpleConstructors
Field enableSimpleConstructors
-
enableToString
protected boolean enableToString
Field enableToString
-
enableSetters
protected boolean enableSetters
Field enableSetters
-
enableGetters
protected boolean enableGetters
Field enableGetters
-
enableEquals
protected boolean enableEquals
Field enableEquals
-
enableHashCode
protected boolean enableHashCode
Field enableHashCode
-
enableMemberFields
protected boolean enableMemberFields
Field enableMemberFields
-
isAny
protected boolean isAny
Field isAny
-
isMixed
protected boolean isMixed
Field isMixed
-
parentIsAny
protected boolean parentIsAny
Field parentIsAny
-
parentIsMixed
protected boolean parentIsMixed
Field parentIsMixed
-
-
Constructor Detail
-
JavaBeanWriter
protected JavaBeanWriter(Emitter emitter, TypeEntry type, java.util.Vector elements, TypeEntry extendType, java.util.Vector attributes, JavaWriter helper)
Constructor.- Parameters:
emitter
-type
- The type representing this classelements
- Vector containing the Type and name of each propertyextendType
- The type representing the extended class (or null)attributes
- Vector containing the attribute types and nameshelper
- Helper class writer
-
-
Method Detail
-
writeFileHeader
protected void writeFileHeader(java.io.PrintWriter pw) throws java.io.IOException
Write a common header, including the package name, the class declaration, and the opening curly brace. Prints javadoc from WSDL documentation. (Cannot pull up, type DOM not avail)- Overrides:
writeFileHeader
in classJavaClassWriter
- Throws:
java.io.IOException
-
writeFileBody
protected void writeFileBody(java.io.PrintWriter pw) throws java.io.IOException
Generate the binding for the given complex type.- Specified by:
writeFileBody
in classJavaWriter
- Parameters:
pw
-- Throws:
java.io.IOException
-
preprocess
protected void preprocess()
Builds the names String vector. The even indices are the java class names of the member fields. The odd indices are the member variable names. Also sets the simpleValueType variable to the java class name of the simple value if this bean represents a simple type
-
getBinaryTypeEncoderName
protected java.lang.String getBinaryTypeEncoderName(java.lang.String elementName)
Returns the class name that should be used to serialize and deserialize this binary element
-
getElementDecl
protected TypeEntry getElementDecl(java.lang.String elementName)
Returns the TypeEntry of the given element
-
getClassModifiers
protected java.lang.String getClassModifiers()
Returns the appropriate extends text- Overrides:
getClassModifiers
in classJavaClassWriter
- Returns:
- "" or "abstract "
-
getExtendsText
protected java.lang.String getExtendsText()
Returns the appropriate extends text- Overrides:
getExtendsText
in classJavaClassWriter
- Returns:
- "" or " extends
"
-
getImplementsText
protected java.lang.String getImplementsText()
Returns the appropriate implements text- Overrides:
getImplementsText
in classJavaClassWriter
- Returns:
- " implements
"
-
writeMemberFields
protected void writeMemberFields()
Writes the member fields.
-
writeDefaultConstructor
protected void writeDefaultConstructor()
Writes the default constructor.
-
writeMinimalConstructor
protected void writeMinimalConstructor()
-
writeFullConstructor
protected void writeFullConstructor()
Writes the full constructor. Note that this class is not recommended for JSR 101 compliant beans, but is provided for extended classes which may wish to generate a full constructor.
-
writeSimpleConstructors
protected void writeSimpleConstructors()
Writes the constructors for SimpleTypes. Writes a constructor accepting a string and a constructor accepting the simple java type.
-
writeSimpleTypeGetter
protected void writeSimpleTypeGetter(java.lang.String simpleValueType, java.lang.String name, java.lang.String returnString)
Method writeSimpleTypeGetter- Parameters:
simpleValueType
-name
-returnString
-
-
writeToStringMethod
protected void writeToStringMethod()
Writes the toString method Currently the toString method is only written for simpleTypes.
-
writeSimpleTypeSetter
protected void writeSimpleTypeSetter(java.lang.String simpleValueType)
Method writeSimpleTypeSetter- Parameters:
simpleValueType
-
-
writeAccessMethods
protected void writeAccessMethods()
Writes the setter and getter methods
-
writeEqualsMethod
protected void writeEqualsMethod()
Writes a general purpose equals method
-
writeHashCodeMethod
protected void writeHashCodeMethod()
Writes a general purpose hashCode method.
-
generate
public void generate() throws java.io.IOException
Generate a java source file and/or helper source file. If the emitter works in deploy mode and the class already exists, only the helper is generated. Otherwise, the java bean and helper source are generated.- Specified by:
generate
in interfaceGenerator
- Overrides:
generate
in classJavaWriter
- Throws:
java.io.IOException
-
-