Class StructureHandle
- java.lang.Object
-
- org.eclipse.birt.report.model.api.ElementDetailHandle
-
- org.eclipse.birt.report.model.api.ValueHandle
-
- org.eclipse.birt.report.model.api.StructureHandle
-
- Direct Known Subclasses:
ActionHandle
,AggregationArgumentHandle
,CachedMetaDataHandle
,CalculationArgumentHandle
,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
,SortHintHandle
,SortKeyHandle
,StyleRuleHandle
,TimeIntervalHandle
,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
Fields Modifier and Type Field Description protected org.eclipse.birt.report.model.core.StructureContext
structContext
Reference to the structure.-
Fields inherited from class org.eclipse.birt.report.model.api.ElementDetailHandle
elementHandle
-
-
Constructor Summary
Constructors Constructor Description StructureHandle(DesignElementHandle element, org.eclipse.birt.report.model.core.MemberRef ref)
Deprecated.StructureHandle(DesignElementHandle element, org.eclipse.birt.report.model.core.StructureContext context)
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
drop()
Removes this structure from a list property or member.org.eclipse.birt.report.model.core.StructureContext
getContext()
Returns the structure context to the value.IStructureDefn
getDefn()
Returns the definition of the structure.ExpressionHandle
getExpressionProperty(java.lang.String memberName)
Gets the value of the member as an expression.java.lang.String
getExternalizedValue(java.lang.String textIDProp, java.lang.String textProp)
Returns externalized message.java.lang.String
getExternalizedValue(java.lang.String textIDProp, java.lang.String textProp, com.ibm.icu.util.ULocale locale)
Returns the externalized message.protected int
getIntProperty(java.lang.String memberName)
Get the integer value of a member.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.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.boolean
isLocal(java.lang.String memberName)
Determines whether this value is set locally for the given member in this structure.java.util.Iterator
iterator()
Returns an iterator over the members of this structure.void
setDesignTime(boolean isDesignTime)
void
setExpressionProperty(java.lang.String memberName, Expression value)
Sets the value of the member as an expression.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.ValueHandle
getReference
-
Methods inherited from class org.eclipse.birt.report.model.api.ElementDetailHandle
getDesign, getElement, getElementHandle, getModule
-
-
-
-
Constructor Detail
-
StructureHandle
public StructureHandle(DesignElementHandle element, org.eclipse.birt.report.model.core.StructureContext context)
Constructs a handle for a structure within a list property of a given element.- Parameters:
element
- handle to the report element.context
- context of the structure
-
StructureHandle
@Deprecated public StructureHandle(DesignElementHandle element, org.eclipse.birt.report.model.core.MemberRef ref)
Deprecated.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 memberindex
- 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 classValueHandle
- 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 theMemberHandle
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.
-
getIntProperty
protected int getIntProperty(java.lang.String memberName)
Get the integer value of a member.- Parameters:
memberName
- name of the member to get- Returns:
- integer value of the member, or
0
if the member is not set or is not defined.
-
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 typeMemberIterator
.- Returns:
- an iterator over the members of the structure.
- See Also:
MemberIterator
-
getContext
public org.eclipse.birt.report.model.core.StructureContext getContext()
Description copied from class:ValueHandle
Returns the structure context to the value. The context is used to identify a list entry or member.- Specified by:
getContext
in classValueHandle
-
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
- name of the property that defines the message keytextProp
- name of the property that defines the default non-externalized value if the key is not found in message file- Returns:
- externalized message if found, otherwise return the default
non-externalized value defined by property
textProp
-
getExternalizedValue
public java.lang.String getExternalizedValue(java.lang.String textIDProp, java.lang.String textProp, com.ibm.icu.util.ULocale locale)
Returns the externalized message.- Parameters:
textIDProp
- name of the property that defines the message keytextProp
- name of the property that defines the default non-externalized value if the key is not found in message filelocale
- the user-defined locale- Returns:
- externalized message if found, otherwise return the default
non-externalized value defined by property
textProp
-
isDesignTime
public boolean isDesignTime()
Justifies whether this structure handle is generated in design time.- Returns:
if the structure handle is generated in design time, otherwise return .
-
setDesignTime
public void setDesignTime(boolean isDesignTime) throws SemanticException
- Parameters:
isDesignTime
-- Throws:
SemanticException
-
setExpressionProperty
public void setExpressionProperty(java.lang.String memberName, Expression value) throws SemanticException
Sets the value of the member as an expression.- Parameters:
memberName
- name of the member to set.value
- the expression to set- Throws:
SemanticException
- if the member name is not defined on the structure or the value is not valid for the member.
-
getExpressionProperty
public ExpressionHandle getExpressionProperty(java.lang.String memberName)
Gets the value of the member as an expression.- Parameters:
memberName
- name of the member to set.- Returns:
- the expression
- Throws:
SemanticException
- if the member name is not defined on the structure or the value is not valid for the member.
-
isLocal
public boolean isLocal(java.lang.String memberName)
Determines whether this value is set locally for the given member in this structure. It is set if and only if it is defined on this structure local property.- Returns:
true
if the local value is set, otherwisefalse
.
-
-