org.xulux.api.dataprovider
Interface IMapping


public interface IMapping

The Mapping interface. For now empty.

Version:
$Id: IMapping.java,v 1.1 2005/12/18 12:58:24 mvdb Exp $
Author:
Martin van den Bemt

Method Summary
 void addField(IField field)
          Adds a field to the mapping
 IField createField(java.lang.Object object)
          Factory like method to quickly create a field based on the mapping.
 IDataProvider getDataProvider()
           
 IField getField(java.lang.Object object)
          Gets the field specified.
 java.util.List getFields()
           
 java.lang.String getName()
           
 java.lang.Object getValue(java.lang.String field, java.lang.Object object)
          A convenience method, so you can get values on the highest possible level
 void setProperty(java.lang.String name, java.lang.String value)
          Set the property for the mapping
 java.lang.Object setValue(java.lang.String field, java.lang.Object object, java.lang.Object value)
          A convenience method, so you can set values on the highest possible level
 

Method Detail

addField

void addField(IField field)
Adds a field to the mapping

Parameters:
field - the field to add

getFields

java.util.List getFields()
Returns:
a collection of fields in the mapping

getField

IField getField(java.lang.Object object)
Gets the field specified. This will not be passed a string as it was previously, but an object, so implementors can decide themselves how a field is organized.

Parameters:
object - the field to retrieve
Returns:
the field or null of not found

getName

java.lang.String getName()
Returns:
the name of the mapping

setValue

java.lang.Object setValue(java.lang.String field,
                          java.lang.Object object,
                          java.lang.Object value)
A convenience method, so you can set values on the highest possible level

Parameters:
field - the field name to use
object - the object to use. If null the provider will try to create the object
value - the value to set in the object
Returns:
the object in the changed form, or if object was null, the newly created object. if an error occured of somekind, it should be logged and the value null should be returned.

getValue

java.lang.Object getValue(java.lang.String field,
                          java.lang.Object object)
A convenience method, so you can get values on the highest possible level

Parameters:
field - the field name to use
object - the object to use. If null the provider will try to create the object
Returns:
the object, or nul when an error occurred or the value is null.

getDataProvider

IDataProvider getDataProvider()
Returns:
the dataprovider that created the mapping

setProperty

void setProperty(java.lang.String name,
                 java.lang.String value)
Set the property for the mapping

Parameters:
name - the name of the property
value - the value of the property

createField

IField createField(java.lang.Object object)
Factory like method to quickly create a field based on the mapping.

Parameters:
object - the object to create a field for


Copyright © 2002-2007 Martin van den Bemt. All Rights Reserved.