|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.shindig.protocol.conversion.xstream.ImplicitCollectionFieldMapping
public class ImplicitCollectionFieldMapping
ItemFieldMapping defines a mapping of a class within a class to an element name. Where classes are tested, the must implement or extend the specified classes, unlike the standard behaviour of XStream they dont need to be the classes in question.
The structure is used for implicit collections of the form *
<outerobject>
<listelement>
<objectcontent>
</listelement>
<listelement>
<objectcontent>
</listelement>
...
</outerobject>
or
<person>
<emails>
<type></type>
<value></value>
</emails>
<emails>
<type></type>
<value></value>
</emails>
<emails>
<type></type>
<value></value>
</emails>
...
</person>
would be specified with NewItemFieldMapping(Person.class, "emails", ListField.class, "emails");
| Constructor Summary | |
|---|---|
ImplicitCollectionFieldMapping(Class<?> definedIn,
String fieldName,
Class<?> itemType,
String itemFieldName)
Create a Item Field Mapping object specifying that where the class itemType appears in the Class definedIn, the elementName should be used for the Element Name. |
|
| Method Summary | |
|---|---|
String |
getFieldName()
|
String |
getItemFieldName()
|
Class<?> |
getItemType()
|
boolean |
matches(Class<?> definedIn,
Class<?> itemType)
Does this ItemFieldMapping match the supplied classes. |
boolean |
matches(Class<?> definedIn,
String fieldName)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ImplicitCollectionFieldMapping(Class<?> definedIn,
String fieldName,
Class<?> itemType,
String itemFieldName)
definedIn - the class which contains the methodfieldName - the name of the method/field in the class.itemType - the type of the method/field in the class.itemFieldName - the name of element in the xml| Method Detail |
|---|
public boolean matches(Class<?> definedIn,
Class<?> itemType)
definedIn - the class that the target test class is defiend in, this is a real
classitemType - the target class, the real class
public boolean matches(Class<?> definedIn,
String fieldName)
public String getFieldName()
getFieldName in interface com.thoughtworks.xstream.mapper.Mapper.ImplicitCollectionMappingpublic String getItemFieldName()
getItemFieldName in interface com.thoughtworks.xstream.mapper.Mapper.ImplicitCollectionMappingpublic Class<?> getItemType()
getItemType in interface com.thoughtworks.xstream.mapper.Mapper.ImplicitCollectionMapping
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||