Package org.jibx.schema.codegen.extend
Class ExtensionDecorator
java.lang.Object
org.jibx.schema.codegen.extend.NameMatchDecoratorBase
org.jibx.schema.codegen.extend.ExtensionDecorator
- All Implemented Interfaces:
ClassDecorator
Code generation decorator which matches on the generated class name, and when it finds a matching class it sets a
superclass. This also supports setting several of the object attributes on the binding element for the class (which
must be a normal data class, rather than an enumeration).
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
Base class to be set for matched classes.private String
Name of method to be called after an instance of class is unmarshalled (null
if none).private String
Name of method to be called before an instance of class is marshalled (null
if none).private String
Name of method to be called before an instance of class is unmarshalled (null
if none). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
finish
(ElementBase binding, IClassHolder holder) Method called after completing code generation for the target class.void
setBaseClass
(String name) Set base class to be set for matched classes.void
setPostSet
(String name) Set name of method to be called after an instance of class is unmarshalled.void
Set name of method to be called before an instance of class is marshalled.void
Set name of method to be called before an instance of class is unmarshalled.void
start
(IClassHolder holder) Method called before starting code generation for the target class.void
valueAdded
(String basename, boolean collect, String type, FieldDeclaration field, MethodDeclaration getmeth, MethodDeclaration setmeth, String descript, IClassHolder holder) Method called after adding each data value to class.Methods inherited from class org.jibx.schema.codegen.extend.NameMatchDecoratorBase
matchName, setMatchName
-
Field Details
-
m_baseClass
Base class to be set for matched classes. -
m_postSetName
Name of method to be called after an instance of class is unmarshalled (null
if none). -
m_preSetName
Name of method to be called before an instance of class is unmarshalled (null
if none). -
m_preGetName
Name of method to be called before an instance of class is marshalled (null
if none).
-
-
Constructor Details
-
ExtensionDecorator
public ExtensionDecorator()
-
-
Method Details
-
setBaseClass
Set base class to be set for matched classes.- Parameters:
name
-
-
setPostSet
Set name of method to be called after an instance of class is unmarshalled.- Parameters:
name
-
-
setPreSet
Set name of method to be called before an instance of class is unmarshalled.- Parameters:
name
-
-
setPreGet
Set name of method to be called before an instance of class is marshalled.- Parameters:
name
-
-
finish
Method called after completing code generation for the target class. This sets the object attributes, if needed.- Parameters:
binding
-holder
-
-
start
Method called before starting code generation for the target class. This just sets the superclass.- Parameters:
holder
-
-
valueAdded
public void valueAdded(String basename, boolean collect, String type, FieldDeclaration field, MethodDeclaration getmeth, MethodDeclaration setmeth, String descript, IClassHolder holder) Method called after adding each data value to class. Unused for this decorator.- Parameters:
basename
- base name used for data valuecollect
- repeated value flagtype
- value type (item value type, in the case of a repeated value)field
- actual fieldgetmeth
- read access methodsetmeth
- write access methoddescript
- value description textholder
-
-