Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile
11g Release 2 (11.1.2.3.0)

E27204-01


oracle.adfmf.util
Interface GenericType


public interface GenericType

Generic representation of a data control's data provider object. It exposes meta information about the providers attributes and accessors, as well as the ability to get and set their values.

This interface abstracts the raw data provider object from the nature of its type of data control; the raw provider can be a deserialized representation of an object returned by a SOAP or REST web service call, or it can be an actual java class instance.

This interface is used primarily by the internals of the embedded java data control framework, however it can also be used when invoking data control methods directly from application java bean code.

See Also:
GenericTypeBeanSerializationHelper

Method Summary
 void copy(GenericType gt, boolean shallow)
          Used to clone an object
 java.lang.Object getAttribute(int i)
          Return the i'th attribute NOTE: Order of defines does matter, this method will always return the i'th attribute that was defined.
 java.lang.Object getAttribute(int i, java.lang.String format)
          Return the i'th attribute NOTE: Order of defines does matter, this method will always return the i'th attribute that was defined.
 java.lang.Object getAttribute(java.lang.String name)
          Return the attribute value for the given name attribute.
 java.lang.Object getAttribute(java.lang.String name, int index)
          Return the attribute value for the namespace/name attribute
 java.lang.Object getAttribute(java.lang.String namespace, java.lang.String name)
          Return the attribute value for the namespace/name attribute
 int getAttributeCount()
          Return the number of attributes defined for this generic type
 int getAttributeCount(java.lang.String name)
          Return the number of attributes with the given name.
 oracle.adfmf.util.AttributeInfo getAttributeInfo(int i)
          Return the attribute information for the i'th attribute
 oracle.adfmf.util.AttributeInfo getAttributeInfo(java.lang.String name)
          Return the attribute information for the name attribute
 int getAttributeInfoCount()
          Return the number of attribute Infos defined for this generic type
 java.lang.Class getAttributeType(java.lang.String name)
          Return the attribute type for the name attribute
 java.lang.Object getDataProvider()
          Returns the raw data provider instance that this GenericType instance abstracts.
 java.lang.String getName()
          Returns the namespace of the type of this provider, as it is defined in data control metadata.
 java.lang.String getNamespace()
          Returns the name of this provider, as it is defined in data control metadata.
 GenericType getParent()
          Returns the GenericType object in the data provider hierarchy that is the owner of this instance
 java.lang.String getType()
          Returns the name of the type of this provider, as it is defined in data control metadata.
 java.lang.Object insertChild(java.lang.String accessorName, int index, java.lang.Object child)
          Insert a child into the current generic type.
 boolean isComplexType()
          Return true if the attribute is a complex type
 boolean isDeferred()
          Returns whether or not this instance is to be lazy initialized, that is, it is a placeholder in the provider hierarchy which may or may not be updated later.
 boolean isModified()
          Return whether or not the object has been modified.
 boolean isUpdateable(java.lang.String name)
          Returns whether or not the named attribute is updateable
 java.lang.Object removeChild(java.lang.String accessorName, int index)
          Remove a given child from the current generic type
 void restoreDefaults()
          Restore the default values for this type.
 void setAttribute(java.lang.String name, java.lang.Object value)
          Set the value of the given attribute
 void setAttributeModified(java.lang.String name)
          Set the modified flag for the specified attribute.
 void setParent(GenericType parent)
          Set the value of the given attribute NOTE: Order of defines does matter, so setting the i'th attribute will alway set the i'th attribute that was defined.

 

Method Detail

getAttributeCount

int getAttributeCount()
Return the number of attributes defined for this generic type

getAttributeInfoCount

int getAttributeInfoCount()
Return the number of attribute Infos defined for this generic type

getAttribute

java.lang.Object getAttribute(int i)
Return the i'th attribute NOTE: Order of defines does matter, this method will always return the i'th attribute that was defined.
Parameters:
i - the attribute index in question
Returns:
value of the attribute or null

getAttribute

java.lang.Object getAttribute(int i,
                              java.lang.String format)
Return the i'th attribute NOTE: Order of defines does matter, this method will always return the i'th attribute that was defined.
Parameters:
i - the attribute index in question
format - Optional String to specify additional formatting on the attribute. Note that this is not intended to not recurse into children if the attribute is a GenericType.
Returns:
value of the attribute or null

getAttribute

java.lang.Object getAttribute(java.lang.String name)
Return the attribute value for the given name attribute. Developers should not presume the type of an attribute and should obtain the type via the getAttributeType() method on the generic type. The burden is on the developer to properly cast/coerce the 'getAttributeType()' type to the type they wish.
Parameters:
name - of the attribute
Returns:
value of the attribute or null
See Also:
getAttributeType(java.lang.String)

getAttribute

java.lang.Object getAttribute(java.lang.String namespace,
                              java.lang.String name)
Return the attribute value for the namespace/name attribute
Parameters:
namespace - of the attribute
name - of the attribute
Returns:
value of the attribute or null
See Also:
getAttribute(java.lang.String)

getAttribute

java.lang.Object getAttribute(java.lang.String name,
                              int index)
Return the attribute value for the namespace/name attribute
Parameters:
name - of the attribute
Returns:
value of the attribute or null
See Also:
getAttribute(java.lang.String)

getAttributeCount

int getAttributeCount(java.lang.String name)
Return the number of attributes with the given name.

getAttributeInfo

oracle.adfmf.util.AttributeInfo getAttributeInfo(java.lang.String name)
Return the attribute information for the name attribute
Parameters:
name - of the attribute
Returns:
info of the attribute or null

getAttributeInfo

oracle.adfmf.util.AttributeInfo getAttributeInfo(int i)
Return the attribute information for the i'th attribute
Parameters:
i - for the i'th attribute
Returns:
info of the attribute or null

getAttributeType

java.lang.Class getAttributeType(java.lang.String name)
Return the attribute type for the name attribute
Parameters:
name - of the attribute
Returns:
type of the attribute or null

isUpdateable

boolean isUpdateable(java.lang.String name)
Returns whether or not the named attribute is updateable
Parameters:
name - of the attribute
Returns:
true if the name attribute is writeable, false if it is read-only

isDeferred

boolean isDeferred()
Returns whether or not this instance is to be lazy initialized, that is, it is a placeholder in the provider hierarchy which may or may not be updated later.
Returns:

isModified

boolean isModified()
Return whether or not the object has been modified.

setAttributeModified

void setAttributeModified(java.lang.String name)
Set the modified flag for the specified attribute. This should propagate up the parent hierarchy as well.
Parameters:
name -

restoreDefaults

void restoreDefaults()
Restore the default values for this type. This should also set the modified flag to false on attributes without defaults specified.

getNamespace

java.lang.String getNamespace()
Returns the name of this provider, as it is defined in data control metadata.

getName

java.lang.String getName()
Returns the namespace of the type of this provider, as it is defined in data control metadata.

getType

java.lang.String getType()
Returns the name of the type of this provider, as it is defined in data control metadata.

getParent

GenericType getParent()
Returns the GenericType object in the data provider hierarchy that is the owner of this instance
Returns:
the GenericType object that is the owenr of this instance, or null if this is the root provider

getDataProvider

java.lang.Object getDataProvider()
Returns the raw data provider instance that this GenericType instance abstracts.

isComplexType

boolean isComplexType()
Return true if the attribute is a complex type

copy

void copy(GenericType gt,
          boolean shallow)
Used to clone an object
Parameters:
gt - to copy
shallow - to denote if a shallow or deep copy should be done

setAttribute

void setAttribute(java.lang.String name,
                  java.lang.Object value)
Set the value of the given attribute
Parameters:
name - of the attribute
value - of the attribute

setParent

void setParent(GenericType parent)
Set the value of the given attribute NOTE: Order of defines does matter, so setting the i'th attribute will alway set the i'th attribute that was defined.
Parameters:
i - attribute index
value - of the attribute

insertChild

java.lang.Object insertChild(java.lang.String accessorName,
                             int index,
                             java.lang.Object child)
Insert a child into the current generic type.
Parameters:
accessorName - for the child
index - to specify the location
child - the child to be inserted
Returns:
the (possibly wrapped/converted) inserted child object

removeChild

java.lang.Object removeChild(java.lang.String accessorName,
                             int index)
Remove a given child from the current generic type
Parameters:
accessorName - of the child
index - location
Returns:
the Object that replaced the removed object (this is in case the owning collection has been re-parented)

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile
11g Release 2 (11.1.2.3.0)

E27204-01


Copyright © 2012 Oracle. All Rights Reserved.