com.sap.caf.eu.gp.structure.api

Interface IGPStructureInfo


public interface IGPStructureInfo

Describes a structure in the the technical input or output parameters of a callable object. The structure contains attributes and substructures. The structure cardinaltity is described by the following constant

The structure is identified by its technical name and namespace, which is optional. The localized name can be defined for the structure by the public void setNameKey(String nameKey) method. The structure uses the resource accessor defined for the technical description.


Field Summary
static int MULITIPLICITY_0_1
          Defines non-list, not required structure cardinality
static int MULITIPLICITY_0_N
          Defines list, not required structure cardinality
static int MULITIPLICITY_1_1
          Defines non-list, required structure cardinality
static int MULITIPLICITY_1_N
          Defines list, non-empty structure cardinality
 
Method Summary
 IGPAttributeInfo addAttribute(String name, int type)
          Adds a new attribute definition to the structure definition.
 IGPAttributeInfo addAttribute(String name, String namespace, int type)
          Adds a new attribute definition to the structure definition.
 IGPStructureInfo addStructure(String name)
          Adds a substructure to the current structure definition with the specified name and no namespace.
 IGPStructureInfo addStructure(String name, String namespace)
          Adds a substructure to the current structure definition with the specified name and namespace.
 IGPAttributeInfo getAttribute(String name)
          Returns an attribute definition for an attribute with the specified name and no namepsace
 IGPAttributeInfo getAttribute(String name, String namespace)
          Returns an attribute definition for an attribute with the specfied name and namespace
 Collection getAttributes()
          Returns a colleaction of the attribute definitions for all attributes in this structure definition
 String getBusinessObjectReference()
          Returns the business object id that is referenced in this structure.
 IGPLabel getLabel()
          Returns the label identifying this structure.
 int getMultiplicity()
          Returns the cardinality of the current structure
 String getNamespace()
          Returns the namespace of the structure
 IGPStructureInfo getStructure(String name)
          Returns the structure definition for the substructure with the specified name and no namespace
 IGPStructureInfo getStructure(String name, String namespace)
          Returns the structure definition for the substructure with the specified name and namecpace
 Collection getStructures()
          Returns all the substructures of the current structure definition.
 String getTechName()
          Returns the technical name of the structure
 IGPAttributeInfo removeAttribute(IGPLabel label)
          Removes an attribute with the given labrl from the current structure definition
 IGPAttributeInfo removeAttribute(String name)
          Removes an attribute with the given name from the current structure definition
 IGPAttributeInfo removeAttribute(String name, String namespace)
          Removes an attribute with the given name and namespace from the current structure definition
 IGPStructureInfo removeStructure(IGPLabel label)
          Removes a sub structure with the given labrl from the current structure definition
 IGPStructureInfo removeStructure(String name)
          Removes a sub structure with the given name from the current structure definition
 IGPStructureInfo removeStructure(String name, String namespace)
          Removes a sub structure with the given name and namespace from the current structure definition
 String resolveText(Locale locale)
          Resolves the language dependent text for the description.
 void setBusinessObjectReference(String businessObjectId)
          Sets he current structure as reference to a business object
 void setMultiplicity(int multiplicity)
          Sets the cardinality of the current structure
 void setNameKey(String name)
          Sets the key for the localized name of the structure
 String toString()
          Overriden default-method.
 

Field Detail

MULITIPLICITY_0_1

public static final int MULITIPLICITY_0_1
Defines non-list, not required structure cardinality

See Also:
Constant Field Values

MULITIPLICITY_1_1

public static final int MULITIPLICITY_1_1
Defines non-list, required structure cardinality

See Also:
Constant Field Values

MULITIPLICITY_0_N

public static final int MULITIPLICITY_0_N
Defines list, not required structure cardinality

See Also:
Constant Field Values

MULITIPLICITY_1_N

public static final int MULITIPLICITY_1_N
Defines list, non-empty structure cardinality

See Also:
Constant Field Values
Method Detail

getTechName

public String getTechName()
Returns the technical name of the structure

Returns:
the technical name of the structure

setNameKey

public void setNameKey(String name)
Sets the key for the localized name of the structure

Parameters:
name - the key for he localized name of the structure

addAttribute

public IGPAttributeInfo addAttribute(String name,
                                     int type)
                              throws GPInvocationException
Adds a new attribute definition to the structure definition. The attribute name and type are specified. The attribute has no namespace. The type constants are defined in the IGPAttributeInfo interface.

Parameters:
name - the name of the attribute.
type - the type of the attribute
Returns:
the attribute definition.
Throws:
GPInvocationException - if any of the parameters is invalid.

addAttribute

public IGPAttributeInfo addAttribute(String name,
                                     String namespace,
                                     int type)
                              throws GPInvocationException
Adds a new attribute definition to the structure definition. The attribute name, namespace and type arespecified.

Parameters:
name - the name of the attribute
namespace - the namespace of the attribute
type - the type of the attribute
Returns:
the attribute definition
Throws:
GPInvocationException - if any of the parameters is invalid.

getAttributes

public Collection getAttributes()
Returns a colleaction of the attribute definitions for all attributes in this structure definition

Returns:
collection of IGPAttributeInfo attribute definitions

removeAttribute

public IGPAttributeInfo removeAttribute(String name)
                                 throws GPInvocationException
Removes an attribute with the given name from the current structure definition

Parameters:
name - the name of the attribute
Returns:
the attribute that has been removed from the structure definition
Throws:
GPInvocationException - thrown if the parameters are not correct or such attribute does not exist

removeAttribute

public IGPAttributeInfo removeAttribute(String name,
                                        String namespace)
                                 throws GPInvocationException
Removes an attribute with the given name and namespace from the current structure definition

Parameters:
name - the name of the attribute
namespace - the namespace of the attribute
Returns:
the attribute that has been removed from the structure definition
Throws:
GPInvocationException - thrown if the parameters are not correct or such attribute does not exist

removeAttribute

public IGPAttributeInfo removeAttribute(IGPLabel label)
                                 throws GPInvocationException
Removes an attribute with the given labrl from the current structure definition

Parameters:
label - the label of the attribute
Returns:
the attribute that has been removed from the structure definition
Throws:
GPInvocationException - thrown if the parameters are not correct or such attribute does not exist

getAttribute

public IGPAttributeInfo getAttribute(String name)
                              throws GPInvocationException
Returns an attribute definition for an attribute with the specified name and no namepsace

Parameters:
name - the name of the attribute
Returns:
the attribute definition
Throws:
GPInvocationException - if parameter is invalid.

getAttribute

public IGPAttributeInfo getAttribute(String name,
                                     String namespace)
                              throws GPInvocationException
Returns an attribute definition for an attribute with the specfied name and namespace

Parameters:
name - the name of the attribute
namespace - the namspace of the attribute
Returns:
the attribute definition
Throws:
GPInvocationException - if any of the parameters is invalid.

addStructure

public IGPStructureInfo addStructure(String name)
                              throws GPInvocationException
Adds a substructure to the current structure definition with the specified name and no namespace.

Parameters:
name - the name of the new structure.
Returns:
the structure definition
Throws:
GPInvocationException - if parameter is invalid.

addStructure

public IGPStructureInfo addStructure(String name,
                                     String namespace)
                              throws GPInvocationException
Adds a substructure to the current structure definition with the specified name and namespace.

Parameters:
name - the name of the new structure
namespace - the namespace of the new structure
Returns:
the structure definition
Throws:
GPInvocationException - if any of the parameters is invalid.

getStructure

public IGPStructureInfo getStructure(String name)
                              throws GPInvocationException
Returns the structure definition for the substructure with the specified name and no namespace

Parameters:
name - the name of the substructure
Returns:
the structure definition of the substructure
Throws:
GPInvocationException

getStructure

public IGPStructureInfo getStructure(String name,
                                     String namespace)
                              throws GPInvocationException
Returns the structure definition for the substructure with the specified name and namecpace

Parameters:
name - the name of the substructure
namespace - the namespace of the substructure
Returns:
the structure definition for the specified name and namespace
Throws:
GPInvocationException - if any of the parameters is invalid.

getStructures

public Collection getStructures()
Returns all the substructures of the current structure definition.

Returns:
a collection with IGPStructureInfo structure definition

removeStructure

public IGPStructureInfo removeStructure(String name)
                                 throws GPInvocationException
Removes a sub structure with the given name from the current structure definition

Parameters:
name - the name of the sub structure
Returns:
the sub structure that has been removed from the structure definition
Throws:
GPInvocationException - thrown if the parameters are not correct or such structure does not exist

removeStructure

public IGPStructureInfo removeStructure(String name,
                                        String namespace)
                                 throws GPInvocationException
Removes a sub structure with the given name and namespace from the current structure definition

Parameters:
name - the name of the sub structure
namespace - the namespace of the sub structure
Returns:
the sub structure that has been removed from the structure definition
Throws:
GPInvocationException - thrown if the parameters are not correct or such structure does not exist

removeStructure

public IGPStructureInfo removeStructure(IGPLabel label)
                                 throws GPInvocationException
Removes a sub structure with the given labrl from the current structure definition

Parameters:
label - the label of the sub structure
Returns:
the sub structure that has been removed from the structure definition
Throws:
GPInvocationException - thrown if the parameters are not correct or such structure does not exist

getMultiplicity

public int getMultiplicity()
Returns the cardinality of the current structure

Returns:
the structure cardinality

setMultiplicity

public void setMultiplicity(int multiplicity)
                     throws GPInvocationException
Sets the cardinality of the current structure

Parameters:
multiplicity - the structure cardinality
Throws:
GPInvocationException - if a non-existing Multiplicitytype is set. Please refer to IGPAttributeInfo to find valid types.

getNamespace

public String getNamespace()
Returns the namespace of the structure

Returns:
the namespace

getLabel

public IGPLabel getLabel()
Returns the label identifying this structure.

Returns:
the label

resolveText

public String resolveText(Locale locale)
Resolves the language dependent text for the description. Implementations must make sure that a text is resolved according to the language resoltion rules.

Parameters:
locale - the end user's locale. Can be null.
Returns:
the language dependent text to display.

setBusinessObjectReference

public void setBusinessObjectReference(String businessObjectId)
                                throws GPInvocationException
Sets he current structure as reference to a business object

Parameters:
businessObjectId - the id of the references business object
Throws:
GPInvocationException

getBusinessObjectReference

public String getBusinessObjectReference()
Returns the business object id that is referenced in this structure. Returns null if the structure does not reference any business object

Returns:
the id of the business object or null if no buisness object is references

toString

public String toString()
Overriden default-method. Returns IGPStructure as an NON-STANDARDIZED XML-Tree



Copyright 2006 SAP AG Complete Copyright Notice