Interface IModelPropertyInfo
-
public interface IModelPropertyInfo
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidcopy(Object fromInstance, Object toInstance, IPropertyCollector collector)intgetItemCount(Object value)default Collection<? extends Object>getItemsFromParentInstance(Object parentInstance)Collection<? extends Object>getItemsFromValue(Object value)Class<?>getItemType()Get the type of the bound object.IBoundNamedModelInstancegetProperty()Get the associated property for which this info is for.default booleanisJsonKeyRequired()booleanisValueSet(Object parentInstance)IPropertyCollectornewPropertyCollector()static IModelPropertyInfonewPropertyInfo(IBoundNamedModelInstance instance)voidreadValues(IPropertyCollector collector, Object parentInstance, IJsonParsingContext context)Read the value data for the property.booleanreadValues(IPropertyCollector collector, Object parentInstance, StartElement start, IXmlParsingContext context)voidwriteValues(Object parentInstance, IJsonWritingContext context)voidwriteValues(Object value, QName parentName, IXmlWritingContext context)Write avaluethat is notnull.
-
-
-
Method Detail
-
newPropertyInfo
@NonNull static IModelPropertyInfo newPropertyInfo(@NonNull IBoundNamedModelInstance instance)
-
getProperty
@NonNull IBoundNamedModelInstance getProperty()
Get the associated property for which this info is for.- Returns:
- the property
-
getItemCount
int getItemCount(@Nullable Object value)
-
getItemType
@NonNull Class<?> getItemType()
Get the type of the bound object.- Returns:
- the raw type of the bound object
-
newPropertyCollector
@NonNull IPropertyCollector newPropertyCollector()
-
isJsonKeyRequired
default boolean isJsonKeyRequired()
-
readValues
void readValues(@NonNull IPropertyCollector collector, @NonNull Object parentInstance, @NonNull IJsonParsingContext context) throws IOException
Read the value data for the property. At the point that this is called, the parser must be located just after the property/field name has been parsed. This method will return a value based on the property's value type as reported bygetProperty().- Parameters:
collector- used to hold parsed valuescontext- the JSON parsing contextparentInstance- the instance the property is on- Throws:
IOException- if there was an error when reading JSON data
-
readValues
boolean readValues(@NonNull IPropertyCollector collector, @NonNull Object parentInstance, @NonNull StartElement start, @NonNull IXmlParsingContext context) throws IOException, XMLStreamException
- Throws:
IOExceptionXMLStreamException
-
writeValues
void writeValues(@NonNull Object value, @NonNull QName parentName, @NonNull IXmlWritingContext context) throws XMLStreamException, IOException
Write avaluethat is notnull.- Parameters:
value- the value to writeparentName- the XML qualified name of the parent element to writecontext- the XML serialization context- Throws:
XMLStreamException- if an error occurred while generating XML eventsIOException- if an error occurred while writing to the output stream
-
writeValues
void writeValues(@NonNull Object parentInstance, @NonNull IJsonWritingContext context) throws IOException
- Throws:
IOException
-
isValueSet
boolean isValueSet(@NonNull Object parentInstance) throws IOException
- Throws:
IOException
-
getItemsFromParentInstance
@NonNull default Collection<? extends Object> getItemsFromParentInstance(@NonNull Object parentInstance)
-
getItemsFromValue
@NonNull Collection<? extends Object> getItemsFromValue(Object value)
-
copy
void copy(@NonNull Object fromInstance, @NonNull Object toInstance, @NonNull IPropertyCollector collector) throws BindingException
- Throws:
BindingException
-
-