com.ibm.pim.attribute
Interface AttributeDefinition


public interface AttributeDefinition

This interface provides methods pertaining to an attribute definition within a Spec object. This is known as a SpecNode in Script.

Since:
6.0.0

Nested Class Summary
static class AttributeDefinition.Type
          Attribute definition types.
 
Field Summary
static java.lang.String copyright
           
 
Method Summary
 AttributeDefinitionProperty createProperty(AttributeDefinitionProperty.Name name)
          Factory method to create a new property for this attribute
 java.util.List<AttributeDefinition> getChildren()
          Returns the children of this AttributeDefinition, returns an empty collection if no children are present
 java.util.Collection<java.util.Locale> getLocales()
          Get locales for this attribute, if it is localized; returns empty collection otherwise.
 AttributeDefinition getLocalized(java.util.Locale locale)
          Get the localized attribute, according to the locale passed in
 java.lang.String getLocalizedName()
          Returns the localized name for this AttributeDefinition, based on currently selected Locale for Item and Category data display.
 java.lang.String getLocalizedNameforLocale(java.util.Locale locale)
          Returns Localized Name for particular Locale.
 java.util.Map<java.util.Locale,java.lang.String> getLocalizedNames()
          Returns all localized names for each of the selected Locale for the spec.
 int getMaxOccurrence()
          Returns the value of the MAX_OCCURRENCE attribute of this AttributeDefinition
 int getMinOccurrence()
          Returns the value of the MIN_OCCURRENCE attribute of this AttributeDefinition
 java.lang.String getName()
          Returns the name of the AttributeDefinition.
 java.util.Collection<AttributeDefinitionProperty> getOptionalProperties()
          Retrieve attributes of this AttributeDefinition (optional attributes only)
 AttributeDefinition getParent()
          Return the parent AttributeDefinition of this AttributeDefinition, if applicable
 java.lang.String getPath()
          Returns the complete path of this AttributeDefinition in the format SpecName/AttributeDefinitionName
 java.util.Collection<AttributeDefinitionProperty> getProperties()
          Retrieve attributes of this AttributeDefinition (both required and optional attributes)
 AttributeDefinitionProperty getProperty(AttributeDefinitionProperty.Name propertyType)
          Get a property of this attribute
 java.util.Collection<AttributeDefinitionProperty> getRequiredProperties()
          Retrieve attributes of this AttributeDefinition (required attributes only)
 Spec getSpec()
          Return the Spec to which this AttributeDefinition is associated.
 AttributeDefinition.Type getType()
          Returns the type of this AttributeDefinition.
 boolean isGrouping()
          Determine whether this is a Grouping AttributeDefinition
 boolean isLeaf()
          Determine whether this is a leaf AttributeDefinition
 boolean isPrimaryKey()
          Determine whether this is a Primary Key attribute
 boolean isSpecRoot()
          Is this attribute a spec root attribute?
 boolean isSubSpecAttribute()
          Determine whether this attribute is part of a SubSpec rather than a top level Spec
 

Field Detail

copyright

static final java.lang.String copyright
See Also:
Constant Field Values
Method Detail

getType

AttributeDefinition.Type getType()
Returns the type of this AttributeDefinition.

Returns:
the appropriate type of this AttributeDefinition
Throws:
PIMInternalException - If an internal error occurs

getChildren

java.util.List<AttributeDefinition> getChildren()
Returns the children of this AttributeDefinition, returns an empty collection if no children are present

Returns:
a java.util.Collection of AttributeDefinition objects
Throws:
PIMInternalException - If an internal error occurs

getParent

AttributeDefinition getParent()
Return the parent AttributeDefinition of this AttributeDefinition, if applicable

Returns:
the immediate parent AttributeDefinition if applicable, otherwise returns null
Throws:
PIMInternalException - If an internal error occurs

getName

java.lang.String getName()
Returns the name of the AttributeDefinition.

Returns:
the name of this Attribute Definition
Throws:
PIMInternalException - If an internal error occurs

getLocalizedName

java.lang.String getLocalizedName()
Returns the localized name for this AttributeDefinition, based on currently selected Locale for Item and Category data display. If spec of this particular specnode is not localized then it will return AttributeDefinition name getName()

Returns:
the localized name of this AttributeDefinition.If spec is not localized then it will return AttributeDefinition name getName()
Throws:
PIMInternalException - If an internal error occurs

getLocalizedNames

java.util.Map<java.util.Locale,java.lang.String> getLocalizedNames()
Returns all localized names for each of the selected Locale for the spec. If the attribute definition is not localized, returns empty Map

Returns:
Map containing key=Locale and value=corresponding locale value.
Throws:
PIMInternalException - If an internal error occurs

getLocalizedNameforLocale

java.lang.String getLocalizedNameforLocale(java.util.Locale locale)
Returns Localized Name for particular Locale. If spec is not localized or supplied locale is not part of selected locales of the spec, null will be returned.

Parameters:
locale - locale for which localized name needs to be retrived
Returns:
localizedName for particular locale.
Throws:
PIMInternalException - If an internal error occurs
java.lang.IllegalArgumentException - If null locale is passed

getPath

java.lang.String getPath()
Returns the complete path of this AttributeDefinition in the format SpecName/AttributeDefinitionName

Returns:
a String containing the path of this AttributeDefinition
Throws:
PIMInternalException - If an internal error occurs

getMaxOccurrence

int getMaxOccurrence()
Returns the value of the MAX_OCCURRENCE attribute of this AttributeDefinition

Returns:
MAX_OCCURRENCE attribute value for this AttributeDefinition
Throws:
PIMInternalException - If an internal error occurs

getMinOccurrence

int getMinOccurrence()
Returns the value of the MIN_OCCURRENCE attribute of this AttributeDefinition

Returns:
MIN_OCCURRENCE attribute value for this AttributeDefinition
Throws:
PIMInternalException - If an internal error occurs

isGrouping

boolean isGrouping()
Determine whether this is a Grouping AttributeDefinition

Returns:
true if this AttributeDefinition is a Grouping, false otherwise
Throws:
PIMInternalException - If an internal error occurs

isLeaf

boolean isLeaf()
Determine whether this is a leaf AttributeDefinition

Returns:
true if this AttributeDefinition has no children, false otherwise
Throws:
PIMInternalException - If an internal error occurs

isPrimaryKey

boolean isPrimaryKey()
Determine whether this is a Primary Key attribute

Returns:
true if this node is Primary Key attribute, false otherwise
Throws:
PIMInternalException - If an internal error occurs

isSubSpecAttribute

boolean isSubSpecAttribute()
Determine whether this attribute is part of a SubSpec rather than a top level Spec

Returns:
true if this attribute is part of a SubSpec rather than a top level Spec
Throws:
PIMInternalException - If an internal error occurs

getProperties

java.util.Collection<AttributeDefinitionProperty> getProperties()
Retrieve attributes of this AttributeDefinition (both required and optional attributes)

Returns:
a java.util.Collection of AttributeDefinitionProperty objects
Throws:
PIMInternalException - If an internal error occurs

getRequiredProperties

java.util.Collection<AttributeDefinitionProperty> getRequiredProperties()
Retrieve attributes of this AttributeDefinition (required attributes only)

Returns:
a java.util.Collection of AttributeDefinitionProperty objects
Throws:
PIMInternalException - If an internal error occurs

getOptionalProperties

java.util.Collection<AttributeDefinitionProperty> getOptionalProperties()
Retrieve attributes of this AttributeDefinition (optional attributes only)

Returns:
a java.util.Collection of AttributeDefinitionProperty objects
Throws:
PIMInternalException - If an internal error occurs

createProperty

AttributeDefinitionProperty createProperty(AttributeDefinitionProperty.Name name)
Factory method to create a new property for this attribute

Parameters:
name - Name of the AttributeDefinition Property
Returns:
AttributeDefinitionProperty New AttributeDefinitionProperty object
Throws:
PIMInternalException - If an internal error occurs
java.lang.IllegalArgumentException - If null name is passed
PIMAuthorizationException - Reserved for future use

getLocalized

AttributeDefinition getLocalized(java.util.Locale locale)
Get the localized attribute, according to the locale passed in

Parameters:
locale - locale to which this node needs to be localized
Returns:
the localized AttributeDefinition corresponding to this AttributeDefinition and the specified locale. This will return the same AttributeDefinition if the Spec is not localized.
Throws:
PIMInternalException - If an internal error occurs
java.lang.IllegalArgumentException - If the locale passed in is Null or is not part of the available locales for the company

getLocales

java.util.Collection<java.util.Locale> getLocales()
Get locales for this attribute, if it is localized; returns empty collection otherwise.

Returns:
set of locales locales for this node
Throws:
PIMInternalException - If an internal error occurs

isSpecRoot

boolean isSpecRoot()
Is this attribute a spec root attribute?

Returns:
boolean ‘true’ if root, ‘false’ if not a root
Throws:
PIMInternalException - If an internal error occurs

getSpec

Spec getSpec()
Return the Spec to which this AttributeDefinition is associated.

Returns:
Spec Spec object
Throws:
PIMInternalException - If an internal error occurs

getProperty

AttributeDefinitionProperty getProperty(AttributeDefinitionProperty.Name propertyType)
Get a property of this attribute

Parameters:
propertyType - One of the attribute enumeration defined in AttributeDefinitionProperty class
Returns:
AttributeDefinitionProperty A AttributeDefinitionProperty object
Throws:
PIMInternalException - If an internal error occurs
java.lang.IllegalArgumentException - If null propertyType is passed