com.sap.portal.genericcreator

Interface IGCAttribute


public interface IGCAttribute

The interface that defines an attribute specified in <Attribute> tags that are nested in the <Context> or <Action> tags.

Attributes have one value. Text attributes can have many values, one per locale.


Field Summary
static String METADATA_INHERITANCE
           
static String METADATA_IS_ORDERED
           
static String METADATA_TRANSLATION_KEY
           
static String METADATA_TYPE
           
static String TYPE_BOOLEAN
           
static String TYPE_DOUBLE
           
static String TYPE_INTEGER
           
static String TYPE_LONG
           
static String TYPE_STRING
           
static String TYPE_TEXT
           
 
Method Summary
 void addNestedAttribute(IGCAttribute attr)
          Nests a single attribute in this attribute.
 void addValue(String val)
          Sets the value of this attribute.
 String getID()
          Returns the attribute's ID.
 Enumeration getLocales()
          Returns all the locales for which values have been set.
 String getMetaData(String metaDataID)
          Returns metadata for this attribute.
 IGCAttributes getNestedAttributes()
          Returns the collection of attributes nested in this attribute.
 String getTextValue(String locale)
          Returns the String value for the specified locale.
 String getValue(int i)
          Returns the value at a specified index, for multi-value attributes.
 String[] getValues()
          Returns all the values set for this attribute.
 void setMetaData(String metaDataID, String metaDataValue)
          Sets metadata for the specified metadata ID.
 void setNestedAttributes(IGCAttributes nestedAttrs)
          Nests a collection of attributes in this attribute.
 void setTextValue(String val, String locale)
          Adds a value for this attribute for the specified locale.
 

Field Detail

TYPE_STRING

static final String TYPE_STRING
See Also:
Constant Field Values

TYPE_TEXT

static final String TYPE_TEXT
See Also:
Constant Field Values

TYPE_INTEGER

static final String TYPE_INTEGER
See Also:
Constant Field Values

TYPE_DOUBLE

static final String TYPE_DOUBLE
See Also:
Constant Field Values

TYPE_BOOLEAN

static final String TYPE_BOOLEAN
See Also:
Constant Field Values

TYPE_LONG

static final String TYPE_LONG
See Also:
Constant Field Values

METADATA_TYPE

static final String METADATA_TYPE
See Also:
Constant Field Values

METADATA_TRANSLATION_KEY

static final String METADATA_TRANSLATION_KEY
See Also:
Constant Field Values

METADATA_IS_ORDERED

static final String METADATA_IS_ORDERED
See Also:
Constant Field Values

METADATA_INHERITANCE

static final String METADATA_INHERITANCE
See Also:
Constant Field Values
Method Detail

getID

String getID()
Returns the attribute's ID.

Returns:
the attribute's ID

getMetaData

String getMetaData(String metaDataID)
Returns metadata for this attribute.

Valid metadata IDs are those strings for which constants exist in this class with names starting with METADATA_.

Parameters:
metaDataID - a metadata ID
Returns:
the metadata value

setMetaData

void setMetaData(String metaDataID,
                 String metaDataValue)
Sets metadata for the specified metadata ID.

Valid metadata IDs are those strings for which constants exist in this class with names starting with METADATA_.

Parameters:
metaDataID - a metadata ID
metaDataValue - the value for specified metadata

getNestedAttributes

IGCAttributes getNestedAttributes()
Returns the collection of attributes nested in this attribute.

Returns:
the collection of attributes nested in this attribute, or null if no attributes are nested

setNestedAttributes

void setNestedAttributes(IGCAttributes nestedAttrs)
Nests a collection of attributes in this attribute.

Parameters:
nestedAttrs - a collection of attributes to nest in this attribute

addNestedAttribute

void addNestedAttribute(IGCAttribute attr)
Nests a single attribute in this attribute.

If an attribute with the same ID is already nested, the attribute is overwritten.

Parameters:
attr - an attribute to nest in this attribute

addValue

void addValue(String val)
Sets the value of this attribute.

Parameters:
val - the new value of this attribute

setTextValue

void setTextValue(String val,
                  String locale)
Adds a value for this attribute for the specified locale.

If a value for the specified locale exists, the value is overwritten.

Parameters:
val - a value for the specified locale
locale - a locale

getLocales

Enumeration getLocales()
Returns all the locales for which values have been set.

Returns:
an enumeration of String objects that are codes for the locales for which values have been set for this attribute

getTextValue

String getTextValue(String locale)
Returns the String value for the specified locale.

Parameters:
locale - a locale
Returns:
the value set for this attribute for the specified locale

getValue

String getValue(int i)
Returns the value at a specified index, for multi-value attributes.

Returns:
the value at the specified index

getValues

String[] getValues()
Returns all the values set for this attribute.

Returns:
an array of values of this attribute
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] EP-RUNTIME [sap.com] tc/ep/semantics/api api EP-PIN


Copyright 2011 SAP AG Complete Copyright Notice