Class FactoryPropertyHandle
java.lang.Object
org.eclipse.birt.report.model.api.ElementDetailHandle
org.eclipse.birt.report.model.api.FactoryPropertyHandle
A specialized handle for use when creating the Factory data structures. This
handle caches the element definition and property value. It uses specialized
property resolution rules:
- A property value is either a style property or a non-style property.
- A non-style property is set if this element, or any of its ancestor elements, provide a value. It is also considered set if the system provides a default value.
- A property value is considered set only if it is set in the private style of this element or an ancestor element; it is not considered set if it is inherited from a shared style.
The various "get" methods also have special meanings: they convert property values to the format needed by the Factory.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.eclipse.birt.report.model.metadata.ElementPropertyDefn
Handle to the design element.protected Object
The cached property value.Fields inherited from class org.eclipse.birt.report.model.api.ElementDetailHandle
elementHandle
-
Constructor Summary
ConstructorsConstructorDescriptionFactoryPropertyHandle
(DesignElementHandle element, org.eclipse.birt.report.model.metadata.ElementPropertyDefn prop) Constructs a factory property handle with the givenDesignElementHandle
and the definition of the property. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the value as a Boolean.Gets the CSS color value.double
Returns the value as a double.int
Returns the property value as an integer.Returns the value as a number (BigDecimal).Returns the value as a non-localized string.getValue()
Returns the cached factory property value.boolean
isSet()
Tests whether this property value is set for this element.boolean
Tests whether this is a style property.Methods inherited from class org.eclipse.birt.report.model.api.ElementDetailHandle
getDesign, getElement, getElementHandle, getModule
-
Field Details
-
propDefn
protected org.eclipse.birt.report.model.metadata.ElementPropertyDefn propDefnHandle to the design element. -
value
The cached property value.
-
-
Constructor Details
-
FactoryPropertyHandle
public FactoryPropertyHandle(DesignElementHandle element, org.eclipse.birt.report.model.metadata.ElementPropertyDefn prop) Constructs a factory property handle with the givenDesignElementHandle
and the definition of the property.- Parameters:
element
- handle to the design element. It provides the Factory context.prop
- the definition of the property
-
-
Method Details
-
getValue
Returns the cached factory property value.- Returns:
- the cached factory property value.
- See Also:
-
DesignElement.getFactoryProperty(Module, ElementPropertyDefn)
-
isStyleProperty
public boolean isStyleProperty()Tests whether this is a style property.- Returns:
true
if this is a style property, otherwisefalse
.
-
isSet
public boolean isSet()Tests whether this property value is set for this element. It is set if it is defined on this element or any of its parents, or in the element's private style. It is considered unset if it is set on a shared style.- Returns:
true
if the value is set,false
if it is not set
-
getIntValue
public int getIntValue()Returns the property value as an integer.- Returns:
- The value as an integer. Returns 0 if the value cannot be converted to an integer.
-
getStringValue
Returns the value as a non-localized string.- Returns:
- The value as a non-localized string.
-
getFloatValue
public double getFloatValue()Returns the value as a double.- Returns:
- The value as a double. Returns 0 if the value cannot be converted to a double.
-
getNumberValue
Returns the value as a number (BigDecimal).- Returns:
- The value as a number. Returns
null
if the value cannot be converted to a number.
-
getBooleanValue
public boolean getBooleanValue()Returns the value as a Boolean.Note: This method returns false if the value is unset. It DOES NOT return the default value for the property. Call
isSet
before calling this method to determine if the property is set.- Returns:
- the value as a boolean. Returns
false
if the value cannot be converted to a boolean, or if the value is not set.
-
getColorValue
Gets the CSS color value. This is either a CSS (pre-defined) color name or an RGB value encoded in CSS format: rgb(r,g,b). Returnsnull
if the property is not set.- Returns:
- the color value as a string
-