Package org.codehaus.modello.plugins.xml
Class XmlModelHelpers
- java.lang.Object
-
- org.codehaus.modello.plugins.xml.XmlModelHelpers
-
class XmlModelHelpers extends java.lang.Object
Helper methods to deal with XML representation of the model.
-
-
Constructor Summary
Constructors Constructor Description XmlModelHelpers()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description (package private) static ModelField
getContentField(java.util.List<ModelField> modelFields)
Get the field which type isContent
if any.(package private) static java.util.List<ModelField>
getFieldsForXml(ModelClass modelClass, Version version)
Return the XML fields of this class, with proper XML order and no XML transient fields.(package private) static java.util.List<ModelField>
getXmlAttributeFields(java.util.List<ModelField> modelFields)
Gets all fields that are not marked as XML attribute.(package private) static java.lang.String
resolveTagName(java.lang.String fieldTagName, XmlAssociationMetadata xmlAssociationMetadata)
Resolve XML tag name for an item in an association with many multiplicity.(package private) static java.lang.String
resolveTagName(ModelClass modelClass)
Resolve XML tag name for a class.(package private) static java.lang.String
resolveTagName(ModelField modelField, XmlFieldMetadata xmlFieldMetadata)
Resolve XML tag name for a field.
-
-
-
Method Detail
-
resolveTagName
static java.lang.String resolveTagName(ModelClass modelClass)
Resolve XML tag name for a class. Note: only root class needs such a resolution.- Parameters:
modelClass
- the model class- Returns:
- the XML tag name for the class
-
resolveTagName
static java.lang.String resolveTagName(ModelField modelField, XmlFieldMetadata xmlFieldMetadata)
Resolve XML tag name for a field.- Parameters:
modelField
- the model fieldxmlFieldMetadata
- the XML metadata of the field- Returns:
- the XML tag name for the field
-
resolveTagName
static java.lang.String resolveTagName(java.lang.String fieldTagName, XmlAssociationMetadata xmlAssociationMetadata)
Resolve XML tag name for an item in an association with many multiplicity.- Parameters:
fieldTagName
- the XML tag name of the field containing the associationxmlAssociationMetadata
- the XML metadata of the association- Returns:
- the XML tag name for items
-
getContentField
static ModelField getContentField(java.util.List<ModelField> modelFields)
Get the field which type isContent
if any.- Parameters:
modelFields
- the fields to check- Returns:
- the field, or
null
if no field isContent
-
getXmlAttributeFields
static java.util.List<ModelField> getXmlAttributeFields(java.util.List<ModelField> modelFields)
Gets all fields that are not marked as XML attribute.- Parameters:
modelFields
- The collection of model fields from which to extract the XML attributes, must not benull
.- Returns:
- The list of XML attributes fields, can be empty but never
null
.
-
getFieldsForXml
static java.util.List<ModelField> getFieldsForXml(ModelClass modelClass, Version version)
Return the XML fields of this class, with proper XML order and no XML transient fields.- Parameters:
modelClass
- current classversion
- the version of the class to use- Returns:
- the list of XML fields of this class
-
-