com.legstar.jaxb.gen
Class JaxbGenModel

java.lang.Object
  extended by com.legstar.codegen.models.AbstractPropertiesModel
      extended by com.legstar.jaxb.gen.JaxbGenModel

public class JaxbGenModel
extends AbstractPropertiesModel

Parameters used for the COBOL-annotated JAXB classes generation.


Field Summary
static boolean DEFAULT_ECICOMPATIBLE
          Default value for use ECI compatible mode.
static boolean DEFAULT_GENERATEISSETMETHOD
          Default value for generate isSet method.
static boolean DEFAULT_INTERNALBINDINGS
          Default value for use of internal bindings.
static boolean DEFAULT_NOPACKAGEINFO
          Default value for no package-info generation.
static long DEFAULT_SERIALIZABLE_ID
          Default value for serializable ID.
static String JAXB_ECICOMPATIBLE
          Use the ECI naming conventions.
static String JAXB_INTERNALBINDINGS
          JAXB uses internal bindings.
static String JAXB_NOPACKAGEINFO
          Don't generate package-info.java.
static String JAXB_PACKAGENAME
          JAXB package name.
static String JAXB_XJB_ELEMENTNAME_PREFIX
          Element name prefix.
static String JAXB_XJB_ELEMENTNAME_SUFFIX
          Element name suffix.
static String JAXB_XJB_ISGENERATEISSETMETHOD
          Generate isSet methods.
static String JAXB_XJB_SERIALIZABLE_ID
          Serializable ID.
static String JAXB_XJB_TYPENAME_PREFIX
          Type name prefix.
static String JAXB_XJB_TYPENAME_SUFFIX
          Type name suffix.
static String JAXB_XSD_LOCATION
          Physical location of the XML schema.
static String XJB_CHARSET
          Character set used for the XJB file content.
static String XJB_GENERATOR_NAME
          Velocity identifier for this generator.
static String XJB_TEMPLATE
          A template for a JAXB external binding customization file.
 
Constructor Summary
JaxbGenModel()
          A no-Arg constructor.
JaxbGenModel(Properties props)
          Construct from a properties file.
 
Method Summary
 void generateXjb(File targetFile)
          Creates an external binding customization file ready for JAXB.
 String getElementNamePrefix()
           
 String getElementNameSuffix()
           
 String getJaxbPackageName()
          If specified, generated code will be placed under this Java package.
 long getSerializableUid()
           
 String getTypeNamePrefix()
           
 String getTypeNameSuffix()
           
 String getXsdLocation()
           
 boolean isEciCompatible()
          Whether the ECI naming conventions should be used.
 boolean isGenerateIsSetMethod()
           
 boolean isInternalBindings()
          whether internal bindings or and external binding should be used.
 boolean isNoPackageInfo()
          Prevents generation of JAXB package-info.java which does not compile under JDK 1.5.
 boolean needElementNameXmlTransform()
           
 boolean needTypeNameXmlTransform()
           
 boolean needXmlTransform()
           
 void setEciCompatible(boolean eciCompatible)
          Whether the ECI naming conventions should be used.
 void setElementNamePrefix(String elementNamePrefix)
           
 void setElementNameSuffix(String elementNameSuffix)
           
 void setGenerateIsSetMethod(boolean generateIsSetMethod)
           
 void setInternalBindings(boolean internalBindings)
          Whether internal bindings or and external binding should be used.
 void setJaxbPackageName(String jaxbPackageName)
          If specified, generated code will be placed under this Java package.
 void setNoPackageInfo(boolean noPackageInfo)
          Prevents generation of JAXB package-info.java which does not compile under JDK 1.5.
 void setSerializableUid(long serializableUid)
           
 void setTypeNamePrefix(String typeNamePrefix)
           
 void setTypeNameSuffix(String typeNameSuffix)
           
 void setXsdLocation(String xsdLocation)
           
 Properties toProperties()
           
 
Methods inherited from class com.legstar.codegen.models.AbstractPropertiesModel
getBoolean, getFile, getInt, getLong, getString, getStringList, getURI, putBoolean, putFile, putInt, putLong, putString, putStringList, putURI, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

XJB_TEMPLATE

public static final String XJB_TEMPLATE
A template for a JAXB external binding customization file.

See Also:
Constant Field Values

XJB_CHARSET

public static final String XJB_CHARSET
Character set used for the XJB file content.

See Also:
Constant Field Values

XJB_GENERATOR_NAME

public static final String XJB_GENERATOR_NAME
Velocity identifier for this generator.

See Also:
Constant Field Values

DEFAULT_GENERATEISSETMETHOD

public static final boolean DEFAULT_GENERATEISSETMETHOD
Default value for generate isSet method.

See Also:
Constant Field Values

DEFAULT_SERIALIZABLE_ID

public static final long DEFAULT_SERIALIZABLE_ID
Default value for serializable ID.

See Also:
Constant Field Values

DEFAULT_INTERNALBINDINGS

public static final boolean DEFAULT_INTERNALBINDINGS
Default value for use of internal bindings.

See Also:
Constant Field Values

DEFAULT_ECICOMPATIBLE

public static final boolean DEFAULT_ECICOMPATIBLE
Default value for use ECI compatible mode.

See Also:
Constant Field Values

DEFAULT_NOPACKAGEINFO

public static final boolean DEFAULT_NOPACKAGEINFO
Default value for no package-info generation.

See Also:
Constant Field Values

JAXB_XSD_LOCATION

public static final String JAXB_XSD_LOCATION
Physical location of the XML schema.

See Also:
Constant Field Values

JAXB_XJB_ISGENERATEISSETMETHOD

public static final String JAXB_XJB_ISGENERATEISSETMETHOD
Generate isSet methods.

See Also:
Constant Field Values

JAXB_XJB_SERIALIZABLE_ID

public static final String JAXB_XJB_SERIALIZABLE_ID
Serializable ID.

See Also:
Constant Field Values

JAXB_XJB_ELEMENTNAME_PREFIX

public static final String JAXB_XJB_ELEMENTNAME_PREFIX
Element name prefix.

See Also:
Constant Field Values

JAXB_XJB_ELEMENTNAME_SUFFIX

public static final String JAXB_XJB_ELEMENTNAME_SUFFIX
Element name suffix.

See Also:
Constant Field Values

JAXB_XJB_TYPENAME_PREFIX

public static final String JAXB_XJB_TYPENAME_PREFIX
Type name prefix.

See Also:
Constant Field Values

JAXB_XJB_TYPENAME_SUFFIX

public static final String JAXB_XJB_TYPENAME_SUFFIX
Type name suffix.

See Also:
Constant Field Values

JAXB_PACKAGENAME

public static final String JAXB_PACKAGENAME
JAXB package name.

See Also:
Constant Field Values

JAXB_INTERNALBINDINGS

public static final String JAXB_INTERNALBINDINGS
JAXB uses internal bindings.

See Also:
Constant Field Values

JAXB_ECICOMPATIBLE

public static final String JAXB_ECICOMPATIBLE
Use the ECI naming conventions.

See Also:
Constant Field Values

JAXB_NOPACKAGEINFO

public static final String JAXB_NOPACKAGEINFO
Don't generate package-info.java.

See Also:
Constant Field Values
Constructor Detail

JaxbGenModel

public JaxbGenModel()
A no-Arg constructor.


JaxbGenModel

public JaxbGenModel(Properties props)
Construct from a properties file.

Parameters:
props - the property file
Method Detail

generateXjb

public void generateXjb(File targetFile)
                 throws CodeGenMakeException
Creates an external binding customization file ready for JAXB.

This external binding file has less capabilities than the alternative which is to inject annotations inline in the XML schema but has the advantage of not messing up with the original XML schema.

Parameters:
targetFile - the xjb file that must be created
Throws:
CodeGenMakeException - if generation fails

needXmlTransform

public boolean needXmlTransform()
Returns:
true if an XmlTransform annotation is needed

needTypeNameXmlTransform

public boolean needTypeNameXmlTransform()
Returns:
true if an XmlTransform/typeName annotation is needed

needElementNameXmlTransform

public boolean needElementNameXmlTransform()
Returns:
true if an XmlTransform/elementName annotation is needed

isGenerateIsSetMethod

public boolean isGenerateIsSetMethod()
Returns:
if IsSet Methods should be generated

setGenerateIsSetMethod

public void setGenerateIsSetMethod(boolean generateIsSetMethod)
Parameters:
generateIsSetMethod - if IsSet Methods should be generated

getSerializableUid

public long getSerializableUid()
Returns:
the serialization unique ID. (All JAXB classes must be serializable for LegStar)

setSerializableUid

public void setSerializableUid(long serializableUid)
Parameters:
serializableUid - the serialization unique ID. (All JAXB classes must be serializable for LegStar)

getXsdLocation

public String getXsdLocation()
Returns:
the physical location of the XML Schema

setXsdLocation

public void setXsdLocation(String xsdLocation)
Parameters:
xsdLocation - the physical location of the XML Schema

getTypeNamePrefix

public String getTypeNamePrefix()
Returns:
the prefix to add to type names

setTypeNamePrefix

public void setTypeNamePrefix(String typeNamePrefix)
Parameters:
typeNamePrefix - the prefix to add to type names

getTypeNameSuffix

public String getTypeNameSuffix()
Returns:
the suffix to add to type names

setTypeNameSuffix

public void setTypeNameSuffix(String typeNameSuffix)
Parameters:
typeNameSuffix - the suffix to add to type names

getElementNamePrefix

public String getElementNamePrefix()
Returns:
the prefix to add to element names

setElementNamePrefix

public void setElementNamePrefix(String elementNamePrefix)
Parameters:
elementNamePrefix - the prefix to add to element names

getElementNameSuffix

public String getElementNameSuffix()
Returns:
the suffix to add to element names

setElementNameSuffix

public void setElementNameSuffix(String elementNameSuffix)
Parameters:
elementNameSuffix - the suffix to add to element names

getJaxbPackageName

public String getJaxbPackageName()
If specified, generated code will be placed under this Java package.

Returns:
Java package name

setJaxbPackageName

public void setJaxbPackageName(String jaxbPackageName)
If specified, generated code will be placed under this Java package.

Parameters:
jaxbPackageName - Java package name

isInternalBindings

public boolean isInternalBindings()
whether internal bindings or and external binding should be used.

Returns:
whether internal bindings or and external binding should be used

setInternalBindings

public void setInternalBindings(boolean internalBindings)
Whether internal bindings or and external binding should be used.

Parameters:
internalBindings - whether internal bindings or and external binding should be used

isEciCompatible

public boolean isEciCompatible()
Whether the ECI naming conventions should be used.

Returns:
Whether the ECI naming conventions should be used

setEciCompatible

public void setEciCompatible(boolean eciCompatible)
Whether the ECI naming conventions should be used.

Parameters:
eciCompatible - whether the ECI naming conventions should be used

isNoPackageInfo

public boolean isNoPackageInfo()
Prevents generation of JAXB package-info.java which does not compile under JDK 1.5.

Returns:
true if we should not generate package-info.java

setNoPackageInfo

public void setNoPackageInfo(boolean noPackageInfo)
Prevents generation of JAXB package-info.java which does not compile under JDK 1.5.

Parameters:
noPackageInfo - true if we should not generate package-info.java

toProperties

public Properties toProperties()
Overrides:
toProperties in class AbstractPropertiesModel
Returns:
a properties file holding the values of this object fields


Copyright © 2014 LegSem. All Rights Reserved.