Package org.nuiton.eugene.java
Class ObjectModelTransformerToJava
- java.lang.Object
-
- org.nuiton.eugene.Template<I>
-
- org.nuiton.eugene.Transformer<ObjectModel,O>
-
- org.nuiton.eugene.models.object.ObjectModelTransformer<ObjectModel>
-
- org.nuiton.eugene.java.ObjectModelTransformerToJava
-
- All Implemented Interfaces:
TemplateConfiguration
public abstract class ObjectModelTransformerToJava extends ObjectModelTransformer<ObjectModel>
Created: 28 oct. 2009- Author:
- Florian Desbois - desbois@codelutin.com
-
-
Field Summary
Fields Modifier and Type Field Description protected JavaBuilder
builder
internal builderprotected EugeneCoreTagValues
eugeneTagValues
-
Fields inherited from class org.nuiton.eugene.Transformer
outputModel, outputProperties, outputTemplate, previousTransformer
-
Fields inherited from class org.nuiton.eugene.Template
configuration, excludeTemplates, generatedPackages, model, resourcesHelper
-
Fields inherited from interface org.nuiton.eugene.TemplateConfiguration
PROP_CLASS_LOADER, PROP_DEFAULT_PACKAGE, PROP_ENCODING, PROP_EXCLUDE_TEMPLATES, PROP_GENERATED_PACKAGES, PROP_LAST_MODIFIED_SOURCE, PROP_OVERWRITE, PROP_VERBOSE, PROP_WRITER_REPORT
-
-
Constructor Summary
Constructors Constructor Description ObjectModelTransformerToJava()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ObjectModelAnnotation
addAnnotation(ObjectModelClassifier classifier, ObjectModelElement element, Class<?> annotationType)
Add an annotation of the givenelement
of the givenclassifier
.ObjectModelAnnotation
addAnnotation(ObjectModelClassifier classifier, ObjectModelElement element, String annotationType)
Add an annotation of the givenelement
of the givenclassifier
.ObjectModelAnnotation
addAnnotationParameter(ObjectModelClassifier classifier, ObjectModelAnnotation annotation, String annotationName, Object annotationValue)
Add a parameter to an annotation.protected ObjectModelAttribute
addAttribute(ObjectModelClassifier classifier, String name, Class<?> type, String value, ObjectModelModifier... modifiers)
ObjectModelAttribute
addAttribute(ObjectModelClassifier classifier, String name, String type)
protected ObjectModelAttribute
addAttribute(ObjectModelClassifier classifier, String name, String type, String value, ObjectModelModifier... modifiers)
protected ObjectModelAttribute
addAttribute(ObjectModelClassifier classifier, ObjectModelAttribute attribute)
ObjectModelOperation
addBlock(ObjectModelClassifier classifier, ObjectModelModifier... modifiers)
add an operation to the classifier with the form of a simple block of code.void
addComment(ObjectModelElement element, String comment)
Adds a comment to the givenelement
.protected ObjectModelAttribute
addConstant(ObjectModelClassifier classifier, String name, Class<?> type, String value, ObjectModelModifier visibility)
protected ObjectModelAttribute
addConstant(ObjectModelClassifier classifier, String name, String type, String value, ObjectModelModifier visibility)
protected Set<String>
addConstantsFromDependency(ObjectModelClassifier input, ObjectModelClassifier output)
Search ininput
model, for a enumeration dependency namedJavaGeneratorUtil.DEPENDENCIES_CONSTANTS
.protected ObjectModelOperation
addConstructor(ObjectModelClass clazz, ObjectModelModifier visibility)
protected ObjectModelOperation
addConstructor(ObjectModelEnumeration clazz, ObjectModelModifier visibility)
protected void
addException(ObjectModelOperation operation, Class<?> exception)
protected void
addException(ObjectModelOperation operation, String exception)
protected void
addGeneratedAnnotation(ObjectModelClassifier element)
Add theGenerated
annotation to the givenObjectModelClassifier
protected void
addI18n(StringBuilder buffer, String i18nPrefix, String suffix)
protected void
addImport(ObjectModelClassifier classifier, Class<?> imports)
protected void
addImport(ObjectModelClassifier classifier, String imports)
protected void
addImport(ObjectModelClassifier classifier, ObjectModelClass imports)
ObjectModelClassifier
addInnerClassifier(ObjectModelClass clazz, ObjectModelType type, String name, ObjectModelModifier... modifiers)
protected void
addInterface(ObjectModelClassifier classifier, Class<?> interfaceQualifiedName)
protected void
addInterface(ObjectModelClassifier classifier, String interfaceQualifiedName)
protected void
addLiteral(ObjectModelEnumeration classifier, String name)
protected ObjectModelOperation
addOperation(ObjectModelClassifier classifier, String name, Class<?> type, ObjectModelModifier... modifiers)
protected ObjectModelOperation
addOperation(ObjectModelClassifier classifier, String name, String type, ObjectModelModifier... modifiers)
protected ObjectModelOperation
addOperation(ObjectModelClassifier classifier, ObjectModelOperation operation)
Adds an operation to the given classifier.protected ObjectModelParameter
addParameter(ObjectModelOperation operation, Class<?> type, String name)
protected ObjectModelParameter
addParameter(ObjectModelOperation operation, String type, String name)
void
addStereotype(ObjectModelElement element, String stereotype)
Add a stereotype to the givenelement
.void
addTagValue(String name, String value)
Adds a tag value to the model.void
addTagValue(ObjectModelElement element, String name, String value)
Adds a tag value to the givenelement
.protected ObjectModelAttribute
cloneAttribute(ObjectModelAttribute source, ObjectModelClassifier destination, boolean cloneDocumentation, ObjectModelModifier... modifiers)
clone a given attribute into a classifier of the output modelObjectModelClass
cloneClass(ObjectModelClass source, boolean cloneDocumentation)
creates a clone of the givensource
class in the output model and clones attributes, inheritence declarations and operations into the cloneObjectModelClassifier
cloneClassifier(ObjectModelClassifier source, boolean cloneDocumentation)
creates a clone of the givensource
classifier in the output model and clones attributes, inheritence declaration and operations class-specific, enumeration-specific and interface-specific features of the given classifier will be present in the cloneprotected void
cloneClassifier(ObjectModelClassifier source, ObjectModelClassifier destination, boolean copyDocumentation)
copy attributes, interfaces declartion and operation of a given classifier into another classifier.ObjectModelEnumeration
cloneEnumeration(ObjectModelEnumeration source, boolean cloneDocumentation)
creates a clone of the givensource
enumeration in the output model and clones attributes, inheritence declaration, operations and literals into the cloneObjectModelInterface
cloneInterface(ObjectModelInterface source, boolean cloneDocumentation)
creates a clone of the givensource
interface in the output model and clones attributes, inheritence declaration and operations into the cloneObjectModelOperation
cloneOperation(ObjectModelOperation source, ObjectModelClassifier destination, boolean cloneDocumentation, ObjectModelJavaModifier... modifiers)
Clone thesource
operation into thedestination
classifier.ObjectModelOperation
cloneOperationSignature(ObjectModelOperation source, ObjectModelClassifier destination, boolean cloneDocumentation, ObjectModelModifier... modifiers)
Clone thesource
operation into thedestination
classifier.protected void
cloneStereotypes(ObjectModelClassifier source, ObjectModelClassifier destination)
protected void
cloneTagValues(ObjectModelElement source, ObjectModelElement destination)
Copy all tag values fro the givensource
to the givendestination
.protected void
copyClassifier(ObjectModelClassifier source, ObjectModelClassifier destination, boolean copyDocumentation)
Deprecated.since 2.3, prefer use thecloneClass(ObjectModelClass, boolean)
methodprotected ObjectModelClass
createAbstractClass(String name, String packageName)
protected ObjectModelClass
createClass(String name, String packageName)
ObjectModelEnumeration
createEnumeration(String name, String packageName)
protected ObjectModelInterface
createInterface(String name, String packageName)
protected void
debugOutputModel()
protected void
generateI18nBlock(ObjectModelClassifier input, ObjectModelClassifier output, String i18nPrefix)
Generates a static block with I18n keys for each navigable attributes prefixed by the giveni18nPrefix
.String
getConstantName(String propertyName)
String
getConstantPrefix()
protected String
getConstantPrefix(ObjectModelClassifier input)
protected URL
getFileInClassPath(String fqn)
protected String
getJavaBeanMethodName(String methodPrefix, String propertyName)
protected String
getJavaBeanMethodName(String methodPrefix, String propertyName, String methodSuffix)
protected ObjectModelPackage
getPackage(String packageName)
protected ObjectModelPackage
getPackage(ObjectModelClassifier input)
void
initConstantPrefixFromModel()
Used to initialize constant prefix depends on model tagvalueEugeneCoreTagValues.Store.constantPrefix
.protected ObjectModel
initOutputModel()
Initialization of the Output model.protected Template<ObjectModel>
initOutputTemplate()
Initialization of the Output generator.protected boolean
isInClassPath(String fqn)
Deprecated.since 3.0, use theTemplate.getResourcesHelper()
object directly.protected boolean
isInClassPath(String packageName, String className)
Deprecated.since 3.0, use theTemplate.getResourcesHelper()
object directly.protected boolean
isInClassPath(ObjectModelClassifier classifier)
Deprecated.since 3.0, use theTemplate.getResourcesHelper()
object directly.void
setConstantPrefix(String constantPrefix)
void
setDocumentation(ObjectModelElement element, String documentation)
void
setMaxMultiplicity(ObjectModelAttribute attribute, int multiplicity)
Adds a max multiplicity to the givenattribute
.void
setMinMultiplicity(ObjectModelAttribute attribute, int multiplicity)
Adds a min multiplicity to the givenattribute
.void
setNavigable(ObjectModelAttribute attribute, boolean navigable)
Adds a navigable flag to the givenattribute
.protected void
setOperationBody(ObjectModelOperation operation, String body)
protected void
setSuperClass(ObjectModelClass classifier, Class<?> superclassQualifiedName)
protected void
setSuperClass(ObjectModelClass classifier, String superclassQualifiedName)
-
Methods inherited from class org.nuiton.eugene.models.object.ObjectModelTransformer
transform, transformFromClass, transformFromClassifier, transformFromElement, transformFromEnumeration, transformFromInterface, transformFromModel
-
Methods inherited from class org.nuiton.eugene.Transformer
addOutputProperty, applyTemplate, getDefaultPackageName, getOutputModel, getOutputProperties, getOutputTemplate, init, initPreviousTransformer, transform
-
Methods inherited from class org.nuiton.eugene.Template
getClassLoader, getConfiguration, getEncoding, getExcludeTemplates, getGeneratedPackages, getLastModifiedSource, getModel, getOverwrite, getProperties, getProperty, getProperty, getResourcesHelper, getWriterReport, isOverwrite, isVerbose, setConfiguration, setProperty
-
-
-
-
Field Detail
-
builder
protected JavaBuilder builder
internal builder
-
eugeneTagValues
protected final EugeneCoreTagValues eugeneTagValues
-
-
Method Detail
-
initOutputTemplate
protected Template<ObjectModel> initOutputTemplate()
Description copied from class:Transformer
Initialization of the Output generator. Must be override to instanciate the Generator that will make the generation of the Output model.- Specified by:
initOutputTemplate
in classTransformer<ObjectModel,ObjectModel>
- Returns:
- the output generator
-
initOutputModel
protected ObjectModel initOutputModel()
Description copied from class:Transformer
Initialization of the Output model. Must be override to instanciate and initialize the output model. For ObjectModel you can use, ObjectModelBuilder to build easily an empty ObjectModel.- Specified by:
initOutputModel
in classTransformer<ObjectModel,ObjectModel>
- Returns:
- the output model
-
debugOutputModel
protected void debugOutputModel()
- Specified by:
debugOutputModel
in classObjectModelTransformer<ObjectModel>
-
addGeneratedAnnotation
protected void addGeneratedAnnotation(ObjectModelClassifier element)
Add theGenerated
annotation to the givenObjectModelClassifier
- Parameters:
element
- the element to be generated on which the annotation will be added- Since:
- 2.7
-
createClass
protected ObjectModelClass createClass(String name, String packageName)
-
getPackage
protected ObjectModelPackage getPackage(ObjectModelClassifier input)
-
getPackage
protected ObjectModelPackage getPackage(String packageName)
-
createEnumeration
public ObjectModelEnumeration createEnumeration(String name, String packageName)
-
createAbstractClass
protected ObjectModelClass createAbstractClass(String name, String packageName)
-
createInterface
protected ObjectModelInterface createInterface(String name, String packageName)
-
setSuperClass
protected void setSuperClass(ObjectModelClass classifier, String superclassQualifiedName)
-
setSuperClass
protected void setSuperClass(ObjectModelClass classifier, Class<?> superclassQualifiedName)
-
addInterface
protected void addInterface(ObjectModelClassifier classifier, String interfaceQualifiedName)
-
addInterface
protected void addInterface(ObjectModelClassifier classifier, Class<?> interfaceQualifiedName)
-
addImport
protected void addImport(ObjectModelClassifier classifier, String imports)
-
addImport
protected void addImport(ObjectModelClassifier classifier, ObjectModelClass imports)
-
addImport
protected void addImport(ObjectModelClassifier classifier, Class<?> imports)
-
addTagValue
public void addTagValue(String name, String value)
Adds a tag value to the model.- Parameters:
name
- name of the tag valuevalue
- value of the tag value
-
addTagValue
public void addTagValue(ObjectModelElement element, String name, String value)
Adds a tag value to the givenelement
.- Parameters:
element
- the element on which the tag value is attached.name
- the name of the tag valuevalue
- the value of the tag value
-
getConstantPrefix
protected String getConstantPrefix(ObjectModelClassifier input)
-
addConstant
protected ObjectModelAttribute addConstant(ObjectModelClassifier classifier, String name, String type, String value, ObjectModelModifier visibility) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
addConstant
protected ObjectModelAttribute addConstant(ObjectModelClassifier classifier, String name, Class<?> type, String value, ObjectModelModifier visibility) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
addAttribute
protected ObjectModelAttribute addAttribute(ObjectModelClassifier classifier, String name, String type, String value, ObjectModelModifier... modifiers)
-
addAttribute
protected ObjectModelAttribute addAttribute(ObjectModelClassifier classifier, String name, Class<?> type, String value, ObjectModelModifier... modifiers)
-
addAttribute
protected ObjectModelAttribute addAttribute(ObjectModelClassifier classifier, ObjectModelAttribute attribute)
-
addAttribute
public ObjectModelAttribute addAttribute(ObjectModelClassifier classifier, String name, String type)
-
addConstructor
protected ObjectModelOperation addConstructor(ObjectModelClass clazz, ObjectModelModifier visibility) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
addConstructor
protected ObjectModelOperation addConstructor(ObjectModelEnumeration clazz, ObjectModelModifier visibility) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
addOperation
protected ObjectModelOperation addOperation(ObjectModelClassifier classifier, String name, String type, ObjectModelModifier... modifiers)
-
addOperation
protected ObjectModelOperation addOperation(ObjectModelClassifier classifier, String name, Class<?> type, ObjectModelModifier... modifiers)
-
addOperation
protected ObjectModelOperation addOperation(ObjectModelClassifier classifier, ObjectModelOperation operation)
Adds an operation to the given classifier.- Parameters:
classifier
- the classifier on which the operation will be addedoperation
- the operation to add- Returns:
- the added operation
- Since:
- 2.1.2
-
addLiteral
protected void addLiteral(ObjectModelEnumeration classifier, String name)
-
addParameter
protected ObjectModelParameter addParameter(ObjectModelOperation operation, String type, String name)
-
addParameter
protected ObjectModelParameter addParameter(ObjectModelOperation operation, Class<?> type, String name)
-
addException
protected void addException(ObjectModelOperation operation, String exception)
-
addException
protected void addException(ObjectModelOperation operation, Class<?> exception)
-
setOperationBody
protected void setOperationBody(ObjectModelOperation operation, String body) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
addInnerClassifier
public ObjectModelClassifier addInnerClassifier(ObjectModelClass clazz, ObjectModelType type, String name, ObjectModelModifier... modifiers) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
setDocumentation
public void setDocumentation(ObjectModelElement element, String documentation)
-
setMinMultiplicity
public void setMinMultiplicity(ObjectModelAttribute attribute, int multiplicity)
Adds a min multiplicity to the givenattribute
.- Parameters:
attribute
- the attribute on which the min multiplicty will be settedmultiplicity
- the multiplicity to set- Since:
- 2.1.2
-
setMaxMultiplicity
public void setMaxMultiplicity(ObjectModelAttribute attribute, int multiplicity)
Adds a max multiplicity to the givenattribute
.- Parameters:
attribute
- the attribute on which the min multiplicty will be settedmultiplicity
- the multiplicity to set- Since:
- 2.1.2
-
setNavigable
public void setNavigable(ObjectModelAttribute attribute, boolean navigable)
Adds a navigable flag to the givenattribute
.- Parameters:
attribute
- the attribute on which the navigable flag will be settednavigable
- the navigable flag to set- Since:
- 2.3
-
addComment
public void addComment(ObjectModelElement element, String comment)
Adds a comment to the givenelement
.- Parameters:
element
- the element on which the comment will be added.comment
- the comment to add- Since:
- 2.1.2
-
addAnnotation
public ObjectModelAnnotation addAnnotation(ObjectModelClassifier classifier, ObjectModelElement element, String annotationType)
Add an annotation of the givenelement
of the givenclassifier
. Important note:Since 2.6.4, the behaviour of this method has changed, we only allowed now to pass here a annotation type and no longer a annotation string representation with some parameters...
- Parameters:
classifier
- holder of element to treatelement
- where to add the annotationannotationType
- type of annotation to create- Returns:
- the instanciated annotation
-
addAnnotation
public ObjectModelAnnotation addAnnotation(ObjectModelClassifier classifier, ObjectModelElement element, Class<?> annotationType)
Add an annotation of the givenelement
of the givenclassifier
.- Parameters:
classifier
- holder of element to treatelement
- where to add the annotationannotationType
- type of annotation to create- Returns:
- the instanciated annotation
- Since:
- 2.6.4
-
addAnnotationParameter
public ObjectModelAnnotation addAnnotationParameter(ObjectModelClassifier classifier, ObjectModelAnnotation annotation, String annotationName, Object annotationValue)
Add a parameter to an annotation.- Parameters:
classifier
- holder of element to treatannotation
- where to add the parameterannotationName
- parameter nameannotationValue
- paramter value- Returns:
- the annotation
- Since:
- 2.6.4
-
addBlock
public ObjectModelOperation addBlock(ObjectModelClassifier classifier, ObjectModelModifier... modifiers)
add an operation to the classifier with the form of a simple block of code. use it to add a "static {}" block into an classifier, then use setOperationBody with the returned value of this method to complete the creation of the static block- Parameters:
classifier
- the classifier where the block will be addedmodifiers
- modifiers for the block- Returns:
- the block added
-
addStereotype
public void addStereotype(ObjectModelElement element, String stereotype)
Add a stereotype to the givenelement
.- Parameters:
element
- the element on which the stereotype will be addedstereotype
- the stereotype to add- Since:
- 2.1.2
-
cloneOperationSignature
public ObjectModelOperation cloneOperationSignature(ObjectModelOperation source, ObjectModelClassifier destination, boolean cloneDocumentation, ObjectModelModifier... modifiers)
Clone thesource
operation into thedestination
classifier. name, returnType, parameters, exceptions and tagValues will be cloned. You can specifymodifiers
for the result operation.- Parameters:
source
- operation to clonedestination
- classifier where result operation will be addedcloneDocumentation
- flag to add documentation if some found in modelmodifiers
- extra modifiers- Returns:
- the new operation created in destination classifier
- Since:
- 2.1.2
-
cloneOperation
public ObjectModelOperation cloneOperation(ObjectModelOperation source, ObjectModelClassifier destination, boolean cloneDocumentation, ObjectModelJavaModifier... modifiers)
Clone thesource
operation into thedestination
classifier. whole signature, tagValues and body code will be cloned. You can specifymodifiers
for the result operation.- Parameters:
source
- operation to clonedestination
- classifier where result operation will be addedcloneDocumentation
- flag to add documentation if some found in modelmodifiers
- extra modifiers- Returns:
- the new operation created in destination classifier
- Since:
- 2.1.2
-
cloneAttribute
protected ObjectModelAttribute cloneAttribute(ObjectModelAttribute source, ObjectModelClassifier destination, boolean cloneDocumentation, ObjectModelModifier... modifiers)
clone a given attribute into a classifier of the output model- Parameters:
source
- the original attributedestination
- classifier where the clone will be addedcloneDocumentation
- flag to add documentation if some found in modelmodifiers
- extra modifiers- Returns:
- the clone attribute
- Since:
- 2.1.2
-
cloneTagValues
protected void cloneTagValues(ObjectModelElement source, ObjectModelElement destination)
Copy all tag values fro the givensource
to the givendestination
.- Parameters:
source
- the source elementdestination
- the destination element- Since:
- 2.3
-
cloneStereotypes
protected void cloneStereotypes(ObjectModelClassifier source, ObjectModelClassifier destination)
- Parameters:
source
- the source elementdestination
- the source element- Since:
- 2.3
-
copyClassifier
@Deprecated protected void copyClassifier(ObjectModelClassifier source, ObjectModelClassifier destination, boolean copyDocumentation)
Deprecated.since 2.3, prefer use thecloneClass(ObjectModelClass, boolean)
methodcopy attributes, interfaces declartion and operation of a given classifier into another classifier. class-specific, enumeration-specific and interface-specific features of the given classifier will not be present in the clone. To copy those specific elements, use- Parameters:
source
- the classifier to clone from the source modeldestination
- where to clone the given source onecopyDocumentation
- flag to add documentation if some found in modelcloneClassifier(ObjectModelClassifier, boolean)
- Since:
- 2.1.2
-
cloneClassifier
protected void cloneClassifier(ObjectModelClassifier source, ObjectModelClassifier destination, boolean copyDocumentation)
copy attributes, interfaces declartion and operation of a given classifier into another classifier. class-specific, enumeration-specific and interface-specific features of the given classifier will not be present in the clone. To copy those specific elements, use- Parameters:
source
- the classifier to clone from the source modeldestination
- where to clone the given source onecopyDocumentation
- flag to add documentation if some found in modelcloneClassifier(ObjectModelClassifier, boolean)
- Since:
- 2.3
-
cloneClass
public ObjectModelClass cloneClass(ObjectModelClass source, boolean cloneDocumentation)
creates a clone of the givensource
class in the output model and clones attributes, inheritence declarations and operations into the clone- Parameters:
source
- the class to clone from the source modelcloneDocumentation
- flag to add documentation if some found in model- Returns:
- the clone of the given class
- Since:
- 2.1.2
-
cloneInterface
public ObjectModelInterface cloneInterface(ObjectModelInterface source, boolean cloneDocumentation)
creates a clone of the givensource
interface in the output model and clones attributes, inheritence declaration and operations into the clone- Parameters:
source
- the interface to clone from the source modelcloneDocumentation
- flag to add documentation if some found in model- Returns:
- the clone of the given interface
- Since:
- 2.1.2
-
cloneEnumeration
public ObjectModelEnumeration cloneEnumeration(ObjectModelEnumeration source, boolean cloneDocumentation)
creates a clone of the givensource
enumeration in the output model and clones attributes, inheritence declaration, operations and literals into the clone- Parameters:
source
- the enumeration to clone from the source modelcloneDocumentation
- flag to add documentation if some found in model- Returns:
- the clone of the given enumeration
- Since:
- 2.1.2
-
cloneClassifier
public ObjectModelClassifier cloneClassifier(ObjectModelClassifier source, boolean cloneDocumentation)
creates a clone of the givensource
classifier in the output model and clones attributes, inheritence declaration and operations class-specific, enumeration-specific and interface-specific features of the given classifier will be present in the clone- Parameters:
source
- the classifier to clone from the source modelcloneDocumentation
- flag to add documentation if some found in model- Returns:
- the clone of the given classifier
- Since:
- 2.1.2
-
addConstantsFromDependency
protected Set<String> addConstantsFromDependency(ObjectModelClassifier input, ObjectModelClassifier output)
Search ininput
model, for a enumeration dependency namedJavaGeneratorUtil.DEPENDENCIES_CONSTANTS
. If found, add all literals onoutput
model as constants. You can add aEugeneCoreTagValues.Store.constantPrefix
to your enumeration to prefix constant names.- Parameters:
input
- the input modeloutput
- the ouput model- Returns:
- the set of constants names generated
-
getConstantPrefix
public String getConstantPrefix()
-
setConstantPrefix
public void setConstantPrefix(String constantPrefix)
-
getJavaBeanMethodName
protected String getJavaBeanMethodName(String methodPrefix, String propertyName)
-
getJavaBeanMethodName
protected String getJavaBeanMethodName(String methodPrefix, String propertyName, String methodSuffix)
-
initConstantPrefixFromModel
public void initConstantPrefixFromModel()
Used to initialize constant prefix depends on model tagvalueEugeneCoreTagValues.Store.constantPrefix
. If no tagvalue found, the default value will be an empty prefix.
-
generateI18nBlock
protected void generateI18nBlock(ObjectModelClassifier input, ObjectModelClassifier output, String i18nPrefix)
Generates a static block with I18n keys for each navigable attributes prefixed by the giveni18nPrefix
.- Parameters:
input
- the input classifieroutput
- the output classifier (to generate)i18nPrefix
- the i81n prefix to use
-
addI18n
protected void addI18n(StringBuilder buffer, String i18nPrefix, String suffix)
-
isInClassPath
@Deprecated protected boolean isInClassPath(ObjectModelClassifier classifier)
Deprecated.since 3.0, use theTemplate.getResourcesHelper()
object directly.Checks if the classifier fully qualified name is in class-path and log a message that fqn will not generated if found- Parameters:
classifier
- classifier to test- Returns:
true
if fqn of classifier was found in class-path,false
otherwise.- Since:
- 2.5
-
isInClassPath
@Deprecated protected boolean isInClassPath(String fqn)
Deprecated.since 3.0, use theTemplate.getResourcesHelper()
object directly.Checks if the given fully qualified name is in class-path and log a message that fqn will not generated if found.- Parameters:
fqn
- fully qualified name to test- Returns:
true
if fqn was found in class-path,false
otherwise.- Since:
- 2.5
-
isInClassPath
@Deprecated protected boolean isInClassPath(String packageName, String className)
Deprecated.since 3.0, use theTemplate.getResourcesHelper()
object directly.Checks if the given class (by his package and simple class name) is in class-path and log a message that fqn will not generated if found.- Parameters:
packageName
- package name of the class to testclassName
- class simple name of the class to test- Returns:
true
if fqn was found in class-path,false
otherwise.- Since:
- 2.7.1
-
-