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 JavaBuilderbuilderinternal builderprotected EugeneCoreTagValueseugeneTagValues-
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_I18N_GETTER_FILE, PROP_LAST_MODIFIED_SOURCE, PROP_OUTPUT_DIRECTORY, PROP_OVERWRITE, PROP_RESOURCE_DIRECTORY, 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 ObjectModelAnnotationaddAnnotation(ObjectModelClassifier classifier, ObjectModelElement element, Class<?> annotationType)Add an annotation of the givenelementof the givenclassifier.ObjectModelAnnotationaddAnnotation(ObjectModelClassifier classifier, ObjectModelElement element, String annotationType)Add an annotation of the givenelementof the givenclassifier.voidaddAnnotationClassParameter(ImportsManager manager, ObjectModelClassifier output, ObjectModelAnnotation annotation, String name, Class<?> value)voidaddAnnotationClassParameter(ImportsManager manager, ObjectModelClassifier output, ObjectModelAnnotation annotation, String name, Class<?>... values)voidaddAnnotationClassParameter(ImportsManager manager, ObjectModelClassifier output, ObjectModelAnnotation annotation, String name, String value)voidaddAnnotationClassParameter(ObjectModelClassifier output, ObjectModelAnnotation annotation, String name, Iterable<String> values)ObjectModelAnnotationaddAnnotationParameter(ObjectModelClassifier classifier, ObjectModelAnnotation annotation, String annotationName, Object annotationValue)Add a parameter to an annotation.ObjectModelAttributeaddAttribute(ObjectModelClassifier classifier, String name, Class<?> type, String value, ObjectModelModifier... modifiers)ObjectModelAttributeaddAttribute(ObjectModelClassifier classifier, String name, String type)ObjectModelAttributeaddAttribute(ObjectModelClassifier classifier, String name, String type, String value, ObjectModelModifier... modifiers)ObjectModelAttributeaddAttribute(ObjectModelClassifier classifier, ObjectModelAttribute attribute)ObjectModelOperationaddBlock(ObjectModelClassifier classifier, ObjectModelModifier... modifiers)add an operation to the classifier with the form of a simple block of code.voidaddComment(ObjectModelElement element, String comment)Adds a comment to the givenelement.ObjectModelAttributeaddConstant(ObjectModelClassifier classifier, String name, Class<?> type, String value, ObjectModelModifier visibility)ObjectModelAttributeaddConstant(ObjectModelClassifier classifier, String name, String type, String value, ObjectModelModifier visibility)Set<String>addConstantsFromDependency(ObjectModelClassifier input, ObjectModelClassifier output)Search ininputmodel, for a enumeration dependency namedJavaGeneratorUtil.DEPENDENCIES_CONSTANTS.ObjectModelOperationaddConstructor(ObjectModelClass clazz, ObjectModelModifier visibility)ObjectModelOperationaddConstructor(ObjectModelEnumeration clazz, ObjectModelModifier visibility)voidaddException(ObjectModelOperation operation, Class<?> exception)voidaddException(ObjectModelOperation operation, String exception)voidaddGeneratedAnnotation(ObjectModelClassifier element)Add theGeneratedannotation to the givenObjectModelClassifiervoidaddI18n(StringBuilder buffer, String i18nPrefix, String suffix)voidaddImport(ObjectModelClassifier classifier, Class<?> imports)voidaddImport(ObjectModelClassifier classifier, String imports)voidaddImport(ObjectModelClassifier classifier, ObjectModelClass imports)ObjectModelClassifieraddInnerClassifier(ObjectModelClass clazz, ObjectModelType type, String name, ObjectModelModifier... modifiers)voidaddInterface(ObjectModelClassifier classifier, Class<?> interfaceQualifiedName)voidaddInterface(ObjectModelClassifier classifier, String interfaceQualifiedName)voidaddLiteral(ObjectModelEnumeration classifier, String name)ObjectModelOperationaddOperation(ObjectModelClassifier classifier, String name, Class<?> type, ObjectModelModifier... modifiers)ObjectModelOperationaddOperation(ObjectModelClassifier classifier, String name, String type, ObjectModelModifier... modifiers)ObjectModelOperationaddOperation(ObjectModelClassifier classifier, ObjectModelOperation operation)Adds an operation to the given classifier.ObjectModelParameteraddParameter(ObjectModelOperation operation, Class<?> type, String name)ObjectModelParameteraddParameter(ObjectModelOperation operation, String type, String name)voidaddStereotype(ObjectModelElement element, String stereotype)Add a stereotype to the givenelement.voidaddTagValue(String name, String value)Adds a tag value to the model.voidaddTagValue(ObjectModelElement element, String name, String value)Adds a tag value to the givenelement.ObjectModelAttributecloneAttribute(ObjectModelAttribute source, ObjectModelClassifier destination, boolean cloneDocumentation, ObjectModelModifier... modifiers)clone a given attribute into a classifier of the output modelObjectModelClasscloneClass(ObjectModelClass source, boolean cloneDocumentation)creates a clone of the givensourceclass in the output model and clones attributes, inheritence declarations and operations into the cloneObjectModelClassifiercloneClassifier(ObjectModelClassifier source, boolean cloneDocumentation)creates a clone of the givensourceclassifier in the output model and clones attributes, inheritence declaration and operationsvoidcloneClassifier(ObjectModelClassifier source, ObjectModelClassifier destination, boolean copyDocumentation)copy attributes, interfaces declartion and operation of a given classifier into another classifier.ObjectModelEnumerationcloneEnumeration(ObjectModelEnumeration source, boolean cloneDocumentation)creates a clone of the givensourceenumeration in the output model and clones attributes, inheritence declaration, operations and literals into the cloneObjectModelInterfacecloneInterface(ObjectModelInterface source, boolean cloneDocumentation)creates a clone of the givensourceinterface in the output model and clones attributes, inheritence declaration and operations into the cloneObjectModelOperationcloneOperation(ObjectModelOperation source, ObjectModelClassifier destination, boolean cloneDocumentation, ObjectModelJavaModifier... modifiers)Clone thesourceoperation into thedestinationclassifier.ObjectModelOperationcloneOperationSignature(ObjectModelOperation source, ObjectModelClassifier destination, boolean cloneDocumentation, ObjectModelModifier... modifiers)Clone thesourceoperation into thedestinationclassifier.voidcloneStereotypes(ObjectModelClassifier source, ObjectModelClassifier destination)voidcloneTagValues(ObjectModelElement source, ObjectModelElement destination)Copy all tag values fro the givensourceto the givendestination.voidcopyClassifier(ObjectModelClassifier source, ObjectModelClassifier destination, boolean copyDocumentation)Deprecated.since 2.3, prefer use thecloneClass(ObjectModelClass, boolean)methodObjectModelClasscreateAbstractClass(String name, String packageName)ObjectModelClasscreateClass(String name, String packageName)ObjectModelEnumerationcreateEnumeration(String name, String packageName)ObjectModelInterfacecreateInterface(String name, String packageName)protected voiddebugOutputModel()voidgenerateI18nBlock(ObjectModelClassifier input, ObjectModelClassifier output, String i18nPrefix)Generates a static block with I18n keys for each navigable attributes prefixed by the giveni18nPrefix.StringgetConstantName(String propertyName)StringgetConstantPrefix()StringgetConstantPrefix(ObjectModelClassifier input)URLgetFileInClassPath(String fqn)ImportsManagergetImportManager(ObjectModelClass clazz)StringgetJavaBeanMethodName(String methodPrefix, String propertyName)StringgetJavaBeanMethodName(String methodPrefix, String propertyName, String methodSuffix)StringgetMethodName(boolean useRelativeName, String[] relativeNameExcludes, String methodPrefix, String beanPackageName, String beanName)ObjectModelPackagegetPackage(String packageName)ObjectModelPackagegetPackage(ObjectModelClassifier input)StringimportAndSimplify(ObjectModelClassifier classifier, String imports)voidinitConstantPrefixFromModel()Used to initialize constant prefix depends on model tagvalueEugeneCoreTagValues.Store.constantPrefix.ObjectModelinitOutputModel()Initialization of the Output model.Template<ObjectModel>initOutputTemplate()Initialization of the Output generator.booleanisInClassPath(String fqn)Deprecated.since 3.0, use theTemplate.getResourcesHelper()object directly.booleanisInClassPath(String packageName, String className)Deprecated.since 3.0, use theTemplate.getResourcesHelper()object directly.booleanisInClassPath(ObjectModelClassifier classifier)Deprecated.since 3.0, use theTemplate.getResourcesHelper()object directly.voidsetConstantPrefix(String constantPrefix)voidsetDocumentation(ObjectModelElement element, String documentation)voidsetMaxMultiplicity(ObjectModelAttribute attribute, int multiplicity)Adds a max multiplicity to the givenattribute.voidsetMinMultiplicity(ObjectModelAttribute attribute, int multiplicity)Adds a min multiplicity to the givenattribute.voidsetNavigable(ObjectModelAttribute attribute, boolean navigable)Adds a navigable flag to the givenattribute.voidsetOperationBody(ObjectModelOperation operation, String body)voidsetSuperClass(ObjectModelClass classifier, Class<?> superclassQualifiedName)voidsetSuperClass(ObjectModelClass classifier, String superclassQualifiedName)voidstoreServiceLoaderFile(Class<?> type, List<? extends ObjectModelClassifier> classes, Function<? super ObjectModelClassifier,String> function)List<String>toQualifiedNames(List<? extends ObjectModelClassifier> classes, Function<? super ObjectModelClassifier,String> function)-
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, getLog, getModel, getOverwrite, getProperties, getProperty, getProperty, getResourcesHelper, getWriterReport, isOverwrite, isVerbose, setConfiguration, setLog, setProperty
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuiton.eugene.TemplateConfiguration
getI18nGetterFile, setI18nGetterFile
-
-
-
-
Field Detail
-
builder
protected JavaBuilder builder
internal builder
-
eugeneTagValues
protected final EugeneCoreTagValues eugeneTagValues
-
-
Method Detail
-
initOutputTemplate
public Template<ObjectModel> initOutputTemplate()
Description copied from class:TransformerInitialization of the Output generator. Must be override to instanciate the Generator that will make the generation of the Output model.- Specified by:
initOutputTemplatein classTransformer<ObjectModel,ObjectModel>- Returns:
- the output generator
-
initOutputModel
public ObjectModel initOutputModel()
Description copied from class:TransformerInitialization 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:
initOutputModelin classTransformer<ObjectModel,ObjectModel>- Returns:
- the output model
-
getImportManager
public ImportsManager getImportManager(ObjectModelClass clazz)
-
debugOutputModel
protected void debugOutputModel()
- Specified by:
debugOutputModelin classObjectModelTransformer<ObjectModel>
-
addGeneratedAnnotation
public void addGeneratedAnnotation(ObjectModelClassifier element)
Add theGeneratedannotation to the givenObjectModelClassifier- Parameters:
element- the element to be generated on which the annotation will be added- Since:
- 2.7
-
createClass
public ObjectModelClass createClass(String name, String packageName)
-
getPackage
public ObjectModelPackage getPackage(ObjectModelClassifier input)
-
getPackage
public ObjectModelPackage getPackage(String packageName)
-
createEnumeration
public ObjectModelEnumeration createEnumeration(String name, String packageName)
-
createAbstractClass
public ObjectModelClass createAbstractClass(String name, String packageName)
-
createInterface
public ObjectModelInterface createInterface(String name, String packageName)
-
setSuperClass
public void setSuperClass(ObjectModelClass classifier, String superclassQualifiedName)
-
setSuperClass
public void setSuperClass(ObjectModelClass classifier, Class<?> superclassQualifiedName)
-
addInterface
public void addInterface(ObjectModelClassifier classifier, String interfaceQualifiedName)
-
addInterface
public void addInterface(ObjectModelClassifier classifier, Class<?> interfaceQualifiedName)
-
addImport
public void addImport(ObjectModelClassifier classifier, String imports)
-
addImport
public void addImport(ObjectModelClassifier classifier, ObjectModelClass imports)
-
addImport
public void addImport(ObjectModelClassifier classifier, Class<?> imports)
-
importAndSimplify
public String importAndSimplify(ObjectModelClassifier classifier, String 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
public String getConstantPrefix(ObjectModelClassifier input)
-
addConstant
public ObjectModelAttribute addConstant(ObjectModelClassifier classifier, String name, String type, String value, ObjectModelModifier visibility) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
addConstant
public ObjectModelAttribute addConstant(ObjectModelClassifier classifier, String name, Class<?> type, String value, ObjectModelModifier visibility) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
addAttribute
public ObjectModelAttribute addAttribute(ObjectModelClassifier classifier, String name, String type, String value, ObjectModelModifier... modifiers)
-
addAttribute
public ObjectModelAttribute addAttribute(ObjectModelClassifier classifier, String name, Class<?> type, String value, ObjectModelModifier... modifiers)
-
addAttribute
public ObjectModelAttribute addAttribute(ObjectModelClassifier classifier, ObjectModelAttribute attribute)
-
addAttribute
public ObjectModelAttribute addAttribute(ObjectModelClassifier classifier, String name, String type)
-
addConstructor
public ObjectModelOperation addConstructor(ObjectModelClass clazz, ObjectModelModifier visibility) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
addConstructor
public ObjectModelOperation addConstructor(ObjectModelEnumeration clazz, ObjectModelModifier visibility) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
addOperation
public ObjectModelOperation addOperation(ObjectModelClassifier classifier, String name, String type, ObjectModelModifier... modifiers)
-
addOperation
public ObjectModelOperation addOperation(ObjectModelClassifier classifier, String name, Class<?> type, ObjectModelModifier... modifiers)
-
addOperation
public 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
public void addLiteral(ObjectModelEnumeration classifier, String name)
-
addParameter
public ObjectModelParameter addParameter(ObjectModelOperation operation, String type, String name)
-
addParameter
public ObjectModelParameter addParameter(ObjectModelOperation operation, Class<?> type, String name)
-
addException
public void addException(ObjectModelOperation operation, String exception)
-
addException
public void addException(ObjectModelOperation operation, Class<?> exception)
-
setOperationBody
public 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 givenelementof 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 givenelementof 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
-
addAnnotationClassParameter
public void addAnnotationClassParameter(ImportsManager manager, ObjectModelClassifier output, ObjectModelAnnotation annotation, String name, Class<?> value)
-
addAnnotationClassParameter
public void addAnnotationClassParameter(ImportsManager manager, ObjectModelClassifier output, ObjectModelAnnotation annotation, String name, String value)
-
addAnnotationClassParameter
public void addAnnotationClassParameter(ImportsManager manager, ObjectModelClassifier output, ObjectModelAnnotation annotation, String name, Class<?>... values)
-
addAnnotationClassParameter
public void addAnnotationClassParameter(ObjectModelClassifier output, ObjectModelAnnotation annotation, String name, Iterable<String> values)
-
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 thesourceoperation into thedestinationclassifier. name, returnType, parameters, exceptions and tagValues will be cloned. You can specifymodifiersfor 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 thesourceoperation into thedestinationclassifier. whole signature, tagValues and body code will be cloned. You can specifymodifiersfor 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
public 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
public void cloneTagValues(ObjectModelElement source, ObjectModelElement destination)
Copy all tag values fro the givensourceto the givendestination.- Parameters:
source- the source elementdestination- the destination element- Since:
- 2.3
-
cloneStereotypes
public void cloneStereotypes(ObjectModelClassifier source, ObjectModelClassifier destination)
- Parameters:
source- the source elementdestination- the source element- Since:
- 2.3
-
copyClassifier
@Deprecated public 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
public 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 givensourceclass 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 givensourceinterface 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 givensourceenumeration 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 givensourceclassifier in the output model and clones attributes, inheritence declaration and operationsclass-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
public Set<String> addConstantsFromDependency(ObjectModelClassifier input, ObjectModelClassifier output)
Search ininputmodel, for a enumeration dependency namedJavaGeneratorUtil.DEPENDENCIES_CONSTANTS.If found, add all literals on
outputmodel as constants.You can add a
EugeneCoreTagValues.Store.constantPrefixto 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
public String getJavaBeanMethodName(String methodPrefix, String propertyName)
-
getJavaBeanMethodName
public 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
public 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
public void addI18n(StringBuilder buffer, String i18nPrefix, String suffix)
-
isInClassPath
@Deprecated public 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:
trueif fqn of classifier was found in class-path,falseotherwise.- Since:
- 2.5
-
isInClassPath
@Deprecated public 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:
trueif fqn was found in class-path,falseotherwise.- Since:
- 2.5
-
isInClassPath
@Deprecated public 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:
trueif fqn was found in class-path,falseotherwise.- Since:
- 2.7.1
-
storeServiceLoaderFile
public void storeServiceLoaderFile(Class<?> type, List<? extends ObjectModelClassifier> classes, Function<? super ObjectModelClassifier,String> function)
-
toQualifiedNames
public List<String> toQualifiedNames(List<? extends ObjectModelClassifier> classes, Function<? super ObjectModelClassifier,String> function)
-
-