public class Xpp3ReaderGenerator extends AbstractXpp3Generator
| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
LOCATION_VAR |
private java.lang.String |
locationField |
private static java.lang.String |
SOURCE_PARAM |
private java.lang.String |
trackingArgs |
locationTracker, requiresDomSupport, sourceTrackerstrictXmlAttributesDEFAULT_DATE_FORMAT, domAsXpp3, useJava5| Constructor and Description |
|---|
Xpp3ReaderGenerator() |
| Modifier and Type | Method and Description |
|---|---|
private void |
addTrackingParameters(JMethod method) |
private java.lang.String |
buildNewLocation(java.lang.String source) |
private JMethod |
convertNumericalType(java.lang.String methodName,
JType returnType,
java.lang.String expression,
java.lang.String typeDesc) |
void |
generate(Model model,
java.util.Properties parameters) |
private void |
generateXpp3Reader() |
private JMethod |
getBooleanValue2Method() |
private JMethod |
getBooleanValueMethod() |
private JMethod |
getCharacterValueMethod() |
private JMethod |
getCheckFieldWithDuplicateMethod() |
private JMethod |
getCheckUnknonwElement2Method() |
private JMethod |
getCheckUnknownAttributeMethod() |
private JMethod |
getDateValue2Method() |
private JMethod |
getDateValueMethod() |
private JMethod |
getInterpolatedTrimmed() |
private JMethod |
getNextTagMethod() |
private JMethod |
getRequiredAttributeValueMethod() |
private JMethod |
getTrimmedValueMethod() |
protected void |
initialize(Model model,
java.util.Properties parameters) |
private void |
processField(ModelField field,
XmlFieldMetadata xmlFieldMetadata,
boolean addElse,
JSourceCode sc,
java.lang.String objectName,
JClass jClass)
Generate code to process a field represented as an XML element.
|
private void |
writeAllClassesParser(Model objectModel,
JClass jClass) |
private void |
writeAllClassesReaders(Model objectModel,
JClass jClass) |
private void |
writeBuildDomLocationTrackingMethod(JClass jClass) |
private void |
writeBuildDomMethod(JClass jClass) |
private ModelField |
writeClassAttributesParser(java.util.List<ModelField> modelFields,
java.lang.String objectName,
boolean rootElement,
JSourceCode sc,
JClass jClass) |
private void |
writeClassParser(ModelClass modelClass,
JClass jClass,
boolean rootElement) |
private void |
writeClassReaders(ModelClass modelClass,
JClass jClass,
boolean rootElement) |
private void |
writeHelpers(JClass jClass) |
private void |
writeNewLocation(java.lang.String trackerVariable,
JSourceCode sc) |
private void |
writeNewSetLocation(ModelField field,
java.lang.String objectName,
java.lang.String trackerVariable,
JSourceCode sc) |
private void |
writeNewSetLocation(java.lang.String key,
java.lang.String objectName,
java.lang.String trackerVariable,
JSourceCode sc) |
private void |
writePrimitiveField(ModelField field,
java.lang.String type,
java.lang.String objectName,
java.lang.String locatorName,
java.lang.String locationKey,
java.lang.String setterName,
JSourceCode sc) |
private void |
writeSetLocation(java.lang.String key,
java.lang.String objectName,
java.lang.String trackerVariable,
JSourceCode sc) |
isLocationTrackinggetContentField, getFieldsForXml, getFileName, getValue, resolveTagName, resolveTagName, resolveTagName, writeDateParsingHelperaddModelImport, addModelImports, getClasses, getDefaultValue, getJavaDefaultValue, getPrefix, getValueChecker, initHeader, initHeader, isJavaEnabled, isRelevant, isTrackingSupport, newJSourceWriter, suppressAllWarningscapitalise, contextualize, getBuildContext, getEncoding, getFieldsForClass, getGeneratedVersion, getHeader, getModel, getOutputDirectory, getParameter, getParameter, getParameter, isClassInModel, isCollection, isEmpty, isInnerAssociation, isMap, isPackageWithVersion, singular, uncapitaliseprivate static final java.lang.String SOURCE_PARAM
private static final java.lang.String LOCATION_VAR
private java.lang.String locationField
private java.lang.String trackingArgs
protected void initialize(Model model, java.util.Properties parameters) throws ModelloException
initialize in class AbstractXpp3GeneratorModelloExceptionpublic void generate(Model model, java.util.Properties parameters) throws ModelloException
ModelloExceptionprivate void writeClassReaders(ModelClass modelClass, JClass jClass, boolean rootElement)
private void generateXpp3Reader()
throws ModelloException,
java.io.IOException
ModelloExceptionjava.io.IOExceptionprivate void writeClassParser(ModelClass modelClass, JClass jClass, boolean rootElement)
private ModelField writeClassAttributesParser(java.util.List<ModelField> modelFields, java.lang.String objectName, boolean rootElement, JSourceCode sc, JClass jClass)
private void processField(ModelField field, XmlFieldMetadata xmlFieldMetadata, boolean addElse, JSourceCode sc, java.lang.String objectName, JClass jClass)
field - the field to processxmlFieldMetadata - its XML metadataaddElse - add an else statement before generating a new ifsc - the method source code to add toobjectName - the object name in the sourcejClass - the generated class source fileprivate void writePrimitiveField(ModelField field, java.lang.String type, java.lang.String objectName, java.lang.String locatorName, java.lang.String locationKey, java.lang.String setterName, JSourceCode sc)
private void writeBuildDomMethod(JClass jClass)
private void writeBuildDomLocationTrackingMethod(JClass jClass)
private void writeHelpers(JClass jClass)
private JMethod getCheckUnknonwElement2Method()
private JMethod getNextTagMethod()
private JMethod getCheckUnknownAttributeMethod()
private JMethod getCheckFieldWithDuplicateMethod()
private JMethod getDateValue2Method()
private JMethod getDateValueMethod()
private JMethod getCharacterValueMethod()
private JMethod getBooleanValue2Method()
private JMethod getBooleanValueMethod()
private JMethod getRequiredAttributeValueMethod()
private JMethod getTrimmedValueMethod()
private JMethod getInterpolatedTrimmed()
private JMethod convertNumericalType(java.lang.String methodName, JType returnType, java.lang.String expression, java.lang.String typeDesc)
private void addTrackingParameters(JMethod method)
private void writeNewSetLocation(ModelField field, java.lang.String objectName, java.lang.String trackerVariable, JSourceCode sc)
private void writeNewSetLocation(java.lang.String key,
java.lang.String objectName,
java.lang.String trackerVariable,
JSourceCode sc)
private void writeNewLocation(java.lang.String trackerVariable,
JSourceCode sc)
private java.lang.String buildNewLocation(java.lang.String source)
private void writeSetLocation(java.lang.String key,
java.lang.String objectName,
java.lang.String trackerVariable,
JSourceCode sc)