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 booleanField enableDefaultConstructorprotected booleanField enableEqualsprotected booleanField enableFullConstructorprotected booleanField enableGettersprotected booleanField enableHashCodeprotected booleanField enableMemberFieldsprotected booleanField enableSettersprotected booleanField enableSimpleConstructorsprotected booleanField enableToStringprotected SetField enumerationTypesprotected JavaBeanHelperWriterField helperprotected booleanField isAnyprotected booleanField isMixedprotected VectorField namesprotected booleanField parentIsAnyprotected booleanField parentIsMixedprotected PrintWriterField pwprotected ArrayListField simpleValueTypesFields inherited from class org.apache.axis.wsdl.toJava.JavaClassWriter
className, namespaces, packageNameFields inherited from class org.apache.axis.wsdl.toJava.JavaWriter
emitter, LINE_LENGTH -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedJavaBeanWriter(Emitter emitter, TypeEntry type, Vector elements, TypeEntry extendType, Vector attributes, JavaWriter helper) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidgenerate()Generate a java source file and/or helper source file.protected StringgetBinaryTypeEncoderName(String elementName) Returns the class name that should be used to serialize and deserialize this binary elementprotected StringReturns the appropriate extends textprotected TypeEntrygetElementDecl(String elementName) Returns the TypeEntry of the given elementprotected StringReturns the appropriate extends textprotected StringReturns the appropriate implements textprotected voidBuilds the names String vector.protected voidWrites the setter and getter methodsprotected voidWrites the default constructor.protected voidWrites a general purpose equals methodprotected voidGenerate the binding for the given complex type.protected voidWrite a common header, including the package name, the class declaration, and the opening curly brace.protected voidWrites the full constructor.protected voidWrites a general purpose hashCode method.protected voidWrites the member fields.protected voidprotected voidWrites the constructors for SimpleTypes.protected voidwriteSimpleTypeGetter(String simpleValueType, String name, String returnString) Method writeSimpleTypeGetterprotected voidwriteSimpleTypeSetter(String simpleValueType) Method writeSimpleTypeSetterprotected voidWrites 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, writePackageMethods 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:
writeFileHeaderin classJavaClassWriter- Parameters:
pw-- Throws:
IOException
-
writeFileBody
Generate the binding for the given complex type.- Specified by:
writeFileBodyin 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:
getClassModifiersin classJavaClassWriter- Returns:
- "" or "abstract "
-
getExtendsText
Returns the appropriate extends text- Overrides:
getExtendsTextin classJavaClassWriter- Returns:
- "" or " extends
"
-
getImplementsText
Returns the appropriate implements text- Overrides:
getImplementsTextin 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:
generatein interfaceGenerator- Overrides:
generatein classJavaWriter- Throws:
IOException
-