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
This is Wsdl2java's Complex Type Writer. It writes the .java file.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
Field enableDefaultConstructorprotected boolean
Field enableEqualsprotected boolean
Field enableFullConstructorprotected boolean
Field enableGettersprotected boolean
Field enableHashCodeprotected boolean
Field enableMemberFieldsprotected boolean
Field enableSettersprotected boolean
Field enableSimpleConstructorsprotected boolean
Field enableToStringprotected Set
Field enumerationTypesprotected JavaBeanHelperWriter
Field helperprotected boolean
Field isAnyprotected boolean
Field isMixedprotected Vector
Field namesprotected boolean
Field parentIsAnyprotected boolean
Field parentIsMixedprotected PrintWriter
Field pwprotected ArrayList
Field simpleValueTypesFields 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
ConstructorsModifierConstructorDescriptionprotected
JavaBeanWriter
(Emitter emitter, TypeEntry type, Vector elements, TypeEntry extendType, Vector attributes, JavaWriter helper) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
generate()
Generate a java source file and/or helper source file.protected String
getBinaryTypeEncoderName
(String elementName) Returns the class name that should be used to serialize and deserialize this binary elementprotected String
Returns the appropriate extends textprotected TypeEntry
getElementDecl
(String elementName) Returns the TypeEntry of the given elementprotected String
Returns the appropriate extends textprotected String
Returns the appropriate implements textprotected void
Builds the names String vector.protected void
Writes the setter and getter methodsprotected void
Writes the default constructor.protected void
Writes a general purpose equals methodprotected void
Generate the binding for the given complex type.protected void
Write a common header, including the package name, the class declaration, and the opening curly brace.protected void
Writes the full constructor.protected void
Writes a general purpose hashCode method.protected void
Writes the member fields.protected void
protected void
Writes the constructors for SimpleTypes.protected void
writeSimpleTypeGetter
(String simpleValueType, String name, String returnString) Method writeSimpleTypeGetterprotected void
writeSimpleTypeSetter
(String simpleValueType) Method writeSimpleTypeSetterprotected void
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 Details
-
helper
Field helper -
names
Field names -
simpleValueTypes
Field simpleValueTypes -
enumerationTypes
Field enumerationTypes -
pw
Field pw -
enableDefaultConstructor
protected boolean enableDefaultConstructorField enableDefaultConstructor -
enableFullConstructor
protected boolean enableFullConstructorField enableFullConstructor -
enableSimpleConstructors
protected boolean enableSimpleConstructorsField enableSimpleConstructors -
enableToString
protected boolean enableToStringField enableToString -
enableSetters
protected boolean enableSettersField enableSetters -
enableGetters
protected boolean enableGettersField enableGetters -
enableEquals
protected boolean enableEqualsField enableEquals -
enableHashCode
protected boolean enableHashCodeField enableHashCode -
enableMemberFields
protected boolean enableMemberFieldsField enableMemberFields -
isAny
protected boolean isAnyField isAny -
isMixed
protected boolean isMixedField isMixed -
parentIsAny
protected boolean parentIsAnyField parentIsAny -
parentIsMixed
protected boolean parentIsMixedField parentIsMixed
-
-
Constructor Details
-
JavaBeanWriter
protected JavaBeanWriter(Emitter emitter, TypeEntry type, Vector elements, TypeEntry extendType, 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 Details
-
writeFileHeader
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
- Parameters:
pw
-- Throws:
IOException
-
writeFileBody
Generate the binding for the given complex type.- Specified by:
writeFileBody
in classJavaWriter
- Parameters:
pw
-- Throws:
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
Returns the class name that should be used to serialize and deserialize this binary element -
getElementDecl
Returns the TypeEntry of the given element -
getClassModifiers
Returns the appropriate extends text- Overrides:
getClassModifiers
in classJavaClassWriter
- Returns:
- "" or "abstract "
-
getExtendsText
Returns the appropriate extends text- Overrides:
getExtendsText
in classJavaClassWriter
- Returns:
- "" or " extends
"
-
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
Method writeSimpleTypeGetter- Parameters:
simpleValueType
-name
-returnString
-
-
writeToStringMethod
protected void writeToStringMethod()Writes the toString method Currently the toString method is only written for simpleTypes. -
writeSimpleTypeSetter
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
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:
IOException
-