Package org.codehaus.modello.plugin.java
Class AbstractJavaModelloGenerator
java.lang.Object
org.codehaus.plexus.logging.AbstractLogEnabled
org.codehaus.modello.plugin.AbstractModelloGenerator
org.codehaus.modello.plugin.java.AbstractJavaModelloGenerator
- All Implemented Interfaces:
ModelloGenerator
,org.codehaus.plexus.logging.LogEnabled
,org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable
- Direct Known Subclasses:
AbstractXmlJavaGenerator
,ConverterGenerator
,JavaModelloGenerator
AbstractJavaModelloGenerator - similar in scope to
AbstractModelloGenerator
but with features that
java generators can use.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addModelImport
(JClass jClass, ModelType modelType, String basePackageName) protected void
addModelImports
(JClass jClass, BaseElement baseElem) private String
protected List
<ModelClass> getClasses
(Model model) protected String
getDefaultValue
(ModelAssociation association) private JComment
protected String
getJavaDefaultValue
(ModelField modelField) protected String
getPrefix
(JavaFieldMetadata javaFieldMetadata) protected String
getValueChecker
(String type, String value, ModelField field) protected final boolean
hasJavaSourceSupport
(int source) protected void
initHeader
(JClass clazz) protected void
initHeader
(JInterface interfaze) protected void
initialize
(Model model, Properties parameters) protected boolean
isJavaEnabled
(ModelClass modelClass) protected boolean
isRelevant
(ModelClass modelClass) protected boolean
isTrackingSupport
(ModelClass modelClass) protected JSourceWriter
newJSourceWriter
(String packageName, String className) Create a new java source file writer, with configured encoding.private String
newPrimitiveWrapper
(String type, String value, boolean useJava5) protected void
suppressAllWarnings
(Model objectModel, JStructure structure) Methods inherited from class org.codehaus.modello.plugin.AbstractModelloGenerator
capitalise, contextualize, getBuildContext, getEncoding, getFieldsForClass, getGeneratedVersion, getHeader, getModel, getOutputDirectory, getParameter, getParameter, getParameter, isClassInModel, isCollection, isEmpty, isInnerAssociation, isMap, isPackageWithVersion, newWriter, newWriter, singular, uncapitalise
Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.codehaus.modello.plugin.ModelloGenerator
generate
-
Field Details
-
javaSource
-
domAsXpp3
protected boolean domAsXpp3 -
DEFAULT_DATE_FORMAT
- See Also:
-
-
Constructor Details
-
AbstractJavaModelloGenerator
public AbstractJavaModelloGenerator()
-
-
Method Details
-
initialize
- Overrides:
initialize
in classAbstractModelloGenerator
- Throws:
ModelloException
-
newJSourceWriter
Create a new java source file writer, with configured encoding.- Parameters:
packageName
- the package of the source file to createclassName
- the class of the source file to create- Returns:
- a JSourceWriter with configured encoding
- Throws:
IOException
-
getHeaderComment
-
initHeader
-
initHeader
-
hasJavaSourceSupport
protected final boolean hasJavaSourceSupport(int source) -
suppressAllWarnings
-
addModelImports
- Throws:
ModelloException
-
addModelImport
-
getPrefix
-
getDefaultValue
-
getJavaDefaultValue
- Throws:
ModelloException
-
newPrimitiveWrapper
-
escapeStringLiteral
-
getValueChecker
protected String getValueChecker(String type, String value, ModelField field) throws ModelloException - Throws:
ModelloException
-
getClasses
-
isRelevant
-
isJavaEnabled
-
isTrackingSupport
-