org.eclipse.birt.report.model.api
Class StructureHandle

java.lang.Object
  extended by org.eclipse.birt.report.model.api.ElementDetailHandle
      extended by org.eclipse.birt.report.model.api.ValueHandle
          extended by org.eclipse.birt.report.model.api.StructureHandle
Direct Known Subclasses:
ActionHandle, AggregationArgumentHandle, CachedMetaDataHandle, ColumnHintHandle, ComputedColumnHandle, ConfigVariableHandle, CustomColorHandle, DataSetParameterHandle, DimensionConditionHandle, DimensionJoinConditionHandle, EmbeddedImageHandle, ExtendedPropertyHandle, FilterConditionHandle, FormatValueHandle, HideRuleHandle, IncludedCssStyleSheetHandle, IncludedLibraryHandle, IncludeScriptHandle, JoinConditionHandle, LevelAttributeHandle, OdaDesignerStateHandle, ParamBindingHandle, PropertyBindingHandle, PropertyMaskHandle, ResultSetColumnHandle, RuleHandle, ScriptLibHandle, SearchKeyHandle, SelectionChoiceHandle, SortKeyHandle, StyleRuleHandle, TOCHandle

public class StructureHandle
extends ValueHandle

Handle to a structure within a list property. List properties contain objects called structures. Structures have members that hold data values.

See Also:
MemberHandle

Field Summary
protected  org.eclipse.birt.report.model.core.CachedMemberRef structRef
          Reference to the structure.
 
Fields inherited from class org.eclipse.birt.report.model.api.ElementDetailHandle
elementHandle
 
Constructor Summary
StructureHandle(DesignElementHandle element, org.eclipse.birt.report.model.core.MemberRef ref)
          Constructs a handle for a structure within a list property of a given element.
StructureHandle(SimpleValueHandle valueHandle, int index)
          Constructs a handle for a structure within a list property or a structure member.
 
Method Summary
 void drop()
          Removes this structure from a list property or member.
 IStructureDefn getDefn()
          Returns the definition of the structure.
 java.lang.String getExternalizedValue(java.lang.String textIDProp, java.lang.String textProp)
          Returns externalized message.
 MemberHandle getMember(java.lang.String memberName)
          Returns a handle to a structure member.
 java.lang.Object getProperty(java.lang.String memberName)
          Gets the value of a member.
 IElementPropertyDefn getPropertyDefn()
          Gets the property definition.
 org.eclipse.birt.report.model.core.MemberRef getReference()
          Returns a reference to the structure.
protected  java.lang.String getStringProperty(java.lang.String memberName)
          Get the string value of a member.
 IStructure getStructure()
          Returns the structure.
 boolean isDesignTime()
          Justifies whether this structure handle is generated in design time.
 java.util.Iterator iterator()
          Returns an iterator over the members of this structure.
 void setDesignTime(boolean isDesignTime)
           
 void setProperty(java.lang.String memberName, java.lang.Object value)
          Sets the value of the member.
protected  void setPropertySilently(java.lang.String memberName, java.lang.Object value)
          Set the value of a member without throwing exceptions.
 
Methods inherited from class org.eclipse.birt.report.model.api.ElementDetailHandle
getDesign, getElement, getElementHandle, getModule
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

structRef

protected org.eclipse.birt.report.model.core.CachedMemberRef structRef
Reference to the structure.

Constructor Detail

StructureHandle

public StructureHandle(DesignElementHandle element,
                       org.eclipse.birt.report.model.core.MemberRef ref)
Constructs a handle for a structure within a list property of a given element.

Parameters:
element - handle to the report element.
ref - reference to the structure

StructureHandle

public StructureHandle(SimpleValueHandle valueHandle,
                       int index)
Constructs a handle for a structure within a list property or a structure member.

Parameters:
valueHandle - handle to a list property or member
index - index of the structure within the list
Method Detail

getPropertyDefn

public IElementPropertyDefn getPropertyDefn()
Description copied from class: ValueHandle
Gets the property definition. This is the definition of the property that contains the specific value. If the value is a structure or member, then this is the definition of the property that contains the list that contains the structure that contains the member.

Specified by:
getPropertyDefn in class ValueHandle
Returns:
the property definition

getStructure

public IStructure getStructure()
Returns the structure. The application can cast this to the specific structure type to query the structure directly. Note: do not modify the structure directly; use the MemberHandle class for all modifications.

Returns:
the structure

getProperty

public java.lang.Object getProperty(java.lang.String memberName)
Gets the value of a member.

Parameters:
memberName - name of the member to get
Returns:
String value of the member, or null if the member is not set or is not found.

getStringProperty

protected java.lang.String getStringProperty(java.lang.String memberName)
Get the string value of a member.

Parameters:
memberName - name of the member to get
Returns:
String value of the member, or null if the member is not set or is not found.

setProperty

public void setProperty(java.lang.String memberName,
                        java.lang.Object value)
                 throws SemanticException
Sets the value of the member.

Parameters:
memberName - name of the member to set.
value - the value to set
Throws:
SemanticException - if the member name is not defined on the structure or the value is not valid for the member.

setPropertySilently

protected final void setPropertySilently(java.lang.String memberName,
                                         java.lang.Object value)
Set the value of a member without throwing exceptions. That is the set operation should not failed. This method is designed to be called by the sub-class where that it is certain that a set operation should never failed.

Note that this method will internal swallow exceptions thrown when performing the set operation. The exception will be deemed as internal error. So calling this method when you are sure that exception is a programming error.

Parameters:
memberName - name of the member to set.
value - value to set.

getDefn

public IStructureDefn getDefn()
Returns the definition of the structure.

Returns:
the structure definition

getMember

public MemberHandle getMember(java.lang.String memberName)
Returns a handle to a structure member.

Parameters:
memberName - the name of the member
Returns:
a handle to the member or null if the member is not defined on the structure.

iterator

public java.util.Iterator iterator()
Returns an iterator over the members of this structure. The iterator is of type MemberIterator.

Returns:
an iterator over the members of the structure.
See Also:
MemberIterator

getReference

public org.eclipse.birt.report.model.core.MemberRef getReference()
Returns a reference to the structure.

Specified by:
getReference in class ValueHandle
Returns:
a reference to the structure
See Also:
MemberRef

drop

public void drop()
          throws PropertyValueException
Removes this structure from a list property or member. Once the structure is dropped, the handle should not be used to do any setter operations.

Throws:
PropertyValueException - if the structure is not contained in the list.

getExternalizedValue

public java.lang.String getExternalizedValue(java.lang.String textIDProp,
                                             java.lang.String textProp)
Returns externalized message.

Parameters:
textIDProp - the display key property name
textProp - the property name
Returns:
externalized message.

isDesignTime

public boolean isDesignTime()
Justifies whether this structure handle is generated in design time.

Returns:

setDesignTime

public void setDesignTime(boolean isDesignTime)
                   throws SemanticException
Parameters:
isDesignTime -
Throws:
SemanticException


Copyright © 2008 Actuate Corp. All rights reserved.