public class JavaBeanWriter extends JavaClassWriter
Modifier and Type | Field and Description |
---|---|
protected boolean |
enableDefaultConstructor
Field enableDefaultConstructor
|
protected boolean |
enableEquals
Field enableEquals
|
protected boolean |
enableFullConstructor
Field enableFullConstructor
|
protected boolean |
enableGetters
Field enableGetters
|
protected boolean |
enableHashCode
Field enableHashCode
|
protected boolean |
enableMemberFields
Field enableMemberFields
|
protected boolean |
enableSetters
Field enableSetters
|
protected boolean |
enableSimpleConstructors
Field enableSimpleConstructors
|
protected boolean |
enableToString
Field enableToString
|
protected Set |
enumerationTypes
Field enumerationTypes
|
protected JavaBeanHelperWriter |
helper
Field helper
|
protected boolean |
isAny
Field isAny
|
protected boolean |
isMixed
Field isMixed
|
protected Vector |
names
Field names
|
protected boolean |
parentIsAny
Field parentIsAny
|
protected boolean |
parentIsMixed
Field parentIsMixed
|
protected PrintWriter |
pw
Field pw
|
protected ArrayList |
simpleValueTypes
Field simpleValueTypes
|
className, namespaces, packageName
emitter, LINE_LENGTH
Modifier | Constructor and Description |
---|---|
protected |
JavaBeanWriter(Emitter emitter,
TypeEntry type,
Vector elements,
TypeEntry extendType,
Vector attributes,
JavaWriter helper)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
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 element
|
protected String |
getClassModifiers()
Returns the appropriate extends text
|
protected TypeEntry |
getElementDecl(String elementName)
Returns the TypeEntry of the given element
|
protected String |
getExtendsText()
Returns the appropriate extends text
|
protected String |
getImplementsText()
Returns the appropriate implements text
|
protected void |
preprocess()
Builds the names String vector.
|
protected void |
writeAccessMethods()
Writes the setter and getter methods
|
protected void |
writeDefaultConstructor()
Writes the default constructor.
|
protected void |
writeEqualsMethod()
Writes a general purpose equals method
|
protected void |
writeFileBody(PrintWriter pw)
Generate the binding for the given complex type.
|
protected void |
writeFileHeader(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()
Write a constructor containing the fields in this class.
|
protected void |
writeSimpleConstructors()
Writes the constructors for SimpleTypes.
|
protected void |
writeSimpleTypeGetter(String simpleValueType,
String name,
String returnString)
Method writeSimpleTypeGetter
|
protected void |
writeSimpleTypeSetter(String simpleValueType)
Method writeSimpleTypeSetter
|
protected void |
writeToStringMethod()
Writes the toString method
Currently the toString method is only written for
simpleTypes.
|
getClassName, getClassText, getFileName, getPackage, registerFile, writeFileFooter, writeHeaderComments, writePackage
closePrintWriter, getJavadocDescriptionPart, getPrintWriter, isFileGenerated, verboseMessage, writeComment, writeComment
protected JavaBeanHelperWriter helper
protected Vector names
protected ArrayList simpleValueTypes
protected Set enumerationTypes
protected PrintWriter pw
protected boolean enableDefaultConstructor
protected boolean enableFullConstructor
protected boolean enableSimpleConstructors
protected boolean enableToString
protected boolean enableSetters
protected boolean enableGetters
protected boolean enableEquals
protected boolean enableHashCode
protected boolean enableMemberFields
protected boolean isAny
protected boolean isMixed
protected boolean parentIsAny
protected boolean parentIsMixed
protected JavaBeanWriter(Emitter emitter, TypeEntry type, Vector elements, TypeEntry extendType, Vector attributes, JavaWriter helper)
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 writerprotected void writeFileHeader(PrintWriter pw) throws IOException
writeFileHeader
in class JavaClassWriter
IOException
protected void writeFileBody(PrintWriter pw) throws IOException
writeFileBody
in class JavaWriter
pw
- IOException
protected void preprocess()
protected String getBinaryTypeEncoderName(String elementName)
protected TypeEntry getElementDecl(String elementName)
protected String getClassModifiers()
getClassModifiers
in class JavaClassWriter
protected String getExtendsText()
getExtendsText
in class JavaClassWriter
protected String getImplementsText()
getImplementsText
in class JavaClassWriter
protected void writeMemberFields()
protected void writeDefaultConstructor()
protected void writeMinimalConstructor()
protected void writeFullConstructor()
protected void writeSimpleConstructors()
protected void writeSimpleTypeGetter(String simpleValueType, String name, String returnString)
simpleValueType
- name
- returnString
- protected void writeToStringMethod()
protected void writeSimpleTypeSetter(String simpleValueType)
simpleValueType
- protected void writeAccessMethods()
protected void writeEqualsMethod()
protected void writeHashCodeMethod()
public void generate() throws IOException
generate
in interface Generator
generate
in class JavaWriter
IOException
Copyright © The Apache Software Foundation. All Rights Reserved.