|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.io.xpp3.PropertyMapper
public abstract class PropertyMapper
A abstract object to map an xml value (tag or attribute, or esle?) to a pojo property. Two implementations are given :
PropertyMapper.TagTextContentToProperty to map the text content of a tag to a pojo's propertyPropertyMapper.AttributeValueToProperty to map the text content of a tag to a pojo's propertyXpp3Helper to add some new mappers into a given
dictionnary of mappers.
Xpp3Helper.addTagTextContentMappers(Class, org.nuiton.io.xpp3.DataConverter, boolean, java.util.Map, String[])Xpp3Helper.addAttributeValueMappers(Class, org.nuiton.io.xpp3.DataConverter, boolean, java.util.Map, String[])
| Nested Class Summary | |
|---|---|
static class |
PropertyMapper.AttributeValueToProperty
|
static class |
PropertyMapper.TagTextContentToProperty
|
| Field Summary | |
|---|---|
protected Class<?> |
containerType
the type of the pojo container of the property |
protected PropertyDescriptor |
descriptor
the pojo's property descriptor |
protected String |
name
name of tag (or attribute to deal with) |
protected boolean |
onlyOne
a flag to check to use only once the mapper. |
protected String |
propertyName
the pojo's property to set |
protected DataConverter |
type
the converter from xml to pojo's property type |
| Constructor Summary | |
|---|---|
protected |
PropertyMapper(String tagName,
String propertyName,
Class<?> containerType,
DataConverter type,
boolean onlyOne,
PropertyDescriptor descriptor)
|
| Method Summary | |
|---|---|
Class<?> |
getContainerType()
|
protected abstract Object |
getDataFromXml(org.codehaus.plexus.util.xml.pull.XmlPullParser parser)
|
PropertyDescriptor |
getDescriptor()
|
String |
getName()
|
String |
getPropertyName()
|
String |
getTagName()
|
DataConverter |
getType()
|
boolean |
isOnlyOne()
|
void |
setProperty(Object src,
org.codehaus.plexus.util.xml.pull.XmlPullParser parser,
Set<String> parsed,
boolean strict)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final String name
protected final String propertyName
protected final DataConverter type
protected final Class<?> containerType
protected final PropertyDescriptor descriptor
protected final boolean onlyOne
| Constructor Detail |
|---|
protected PropertyMapper(String tagName,
String propertyName,
Class<?> containerType,
DataConverter type,
boolean onlyOne,
PropertyDescriptor descriptor)
| Method Detail |
|---|
protected abstract Object getDataFromXml(org.codehaus.plexus.util.xml.pull.XmlPullParser parser)
throws org.codehaus.plexus.util.xml.pull.XmlPullParserException,
Exception
org.codehaus.plexus.util.xml.pull.XmlPullParserException
Exception
public void setProperty(Object src,
org.codehaus.plexus.util.xml.pull.XmlPullParser parser,
Set<String> parsed,
boolean strict)
throws org.codehaus.plexus.util.xml.pull.XmlPullParserException,
IOException,
IOException
org.codehaus.plexus.util.xml.pull.XmlPullParserException
IOExceptionpublic PropertyDescriptor getDescriptor()
public boolean isOnlyOne()
public String getPropertyName()
public String getTagName()
public DataConverter getType()
public Class<?> getContainerType()
public String getName()
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||