Class EmbeddedImage
java.lang.Object
org.eclipse.birt.report.model.core.Structure
org.eclipse.birt.report.model.core.ReferencableStructure
org.eclipse.birt.report.model.api.elements.structures.EmbeddedImage
- All Implemented Interfaces:
Cloneable
,IStructure
,org.eclipse.birt.report.model.core.IPropertySet
,org.eclipse.birt.report.model.core.IReferencable
public class EmbeddedImage
extends org.eclipse.birt.report.model.core.ReferencableStructure
Represents an embedded image. The class gives the name and type of the image.
Used when an image element
ImageItem
gives a name. Each embedded image
has the following properties:
- Name
- an embedded image has a unique and required name, so the image item can use the image name to identify an embedded image.
- Type
- an embedded image has a choice and required type: bmp, gif, png or x-png.
- Data
- value of the image data in Base64 encoding.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Encoding mode for the data member.protected String
String of the image data in 8859_1 encoding.static final String
Name of the "data" property.static final String
Name of this structure.protected String
Value of the name property.static final String
Name of the "name" property.protected String
Value of the expression property.static final String
Name of the "type" property.Fields inherited from class org.eclipse.birt.report.model.core.ReferencableStructure
clients, clientStructures, LIB_REFERENCE_MEMBER, libReference
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.EmbeddedImage
(String name) Constructs the image with the given name.EmbeddedImage
(String name, String type) Constructs the image with the required name and type. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
getData
(org.eclipse.birt.report.model.core.Module module) Returns the image data in Base64 encoding.protected Object
getIntrinsicProperty
(String propName) Returns the value of a structure property represented as a member variable.getName()
Returns name of the image.Gets the value of the referencable member.Returns the name of the structure definition.getType
(org.eclipse.birt.report.model.core.Module module) Returns type value this node represents.handle
(SimpleValueHandle valueHandle, int index) Creates the specific handle of this structure.boolean
isReferencableProperty
(String memberName) Checks whether the member of the input name is the referencable member or not.void
setData
(byte[] data) Sets the data of the image.protected void
setIntrinsicProperty
(String propName, Object value) Sets the value of of a structure property represented as a member variable.void
Sets the name of the image.void
Sets the type of the image.validate
(org.eclipse.birt.report.model.core.Module module, org.eclipse.birt.report.model.core.DesignElement element) Validate whether this structure is valid.Methods inherited from class org.eclipse.birt.report.model.core.ReferencableStructure
addClient, addClientStructure, broadcast, clone, dropClient, dropClientStructure, getClientList, getClientStructures, getLocalProperty, getProperty, hasReferences, isReferencable, updateReference
Methods inherited from class org.eclipse.birt.report.model.core.Structure
checkStringMember, copy, equals, getCompatibleValue, getContext, getDefn, getElement, getExpressionProperty, getHandle, getHandle, getLocalProperty, getMemberDefn, getObjectDefn, getProperty, getStringProperty, isDesignTime, setContext, setExpressionProperty, setProperty, setProperty, setupContext, updateReference
-
Field Details
-
EMBEDDED_IMAGE_STRUCT
Name of this structure. Matches the definition in the meta-data dictionary.- See Also:
-
NAME_MEMBER
Name of the "name" property.- See Also:
-
TYPE_MEMBER
Name of the "type" property. It can be:IMAGE_TYPE_IMAGE_BMP
IMAGE_TYPE_IMAGE_GIF
IMAGE_TYPE_IMAGE_PNG
IMAGE_TYPE_IMAGE_X_PNG
- See Also:
-
DATA_MEMBER
Name of the "data" property.- See Also:
-
CHARSET
Encoding mode for the data member.- See Also:
-
name
Value of the name property. -
type
Value of the expression property. -
data
String of the image data in 8859_1 encoding.
-
-
Constructor Details
-
EmbeddedImage
public EmbeddedImage()Default constructor. -
EmbeddedImage
Constructs the image with the given name. The type of the image is set to the default valueDesignChoiceConstants.IMAGE_TYPE_AUTO
.- Parameters:
name
- name of the image
-
EmbeddedImage
Constructs the image with the required name and type.- Parameters:
name
- name of the imagetype
- type of the image
-
-
Method Details
-
getStructName
Description copied from interface:IStructure
Returns the name of the structure definition. The name is the one used to define the structure in the meta-data dictionary.- Returns:
- the internal name of the structure a defined in the meta-data dictionary.
-
getIntrinsicProperty
Description copied from class:org.eclipse.birt.report.model.core.Structure
Returns the value of a structure property represented as a member variable.- Overrides:
getIntrinsicProperty
in classorg.eclipse.birt.report.model.core.ReferencableStructure
- Parameters:
propName
- name of the property- Returns:
- the value of the property, or null if the property is not set
-
setIntrinsicProperty
Description copied from class:org.eclipse.birt.report.model.core.Structure
Sets the value of of a structure property represented as a member variable.- Overrides:
setIntrinsicProperty
in classorg.eclipse.birt.report.model.core.ReferencableStructure
- Parameters:
propName
- the name of the property to setvalue
- the property value
-
getName
Returns name of the image.- Returns:
- name of the image
-
setName
Sets the name of the image.- Parameters:
name
- the name to set
-
getType
Returns type value this node represents. It can be:IMAGE_TYPE_IMAGE_JPEG
IMAGE_TYPE_IMAGE_BMP
IMAGE_TYPE_IMAGE_GIF
IMAGE_TYPE_IMAGE_PNG
IMAGE_TYPE_IMAGE_X_PNG
- Parameters:
module
- the module of this structure- Returns:
- the type value
-
setType
Sets the type of the image. The allowed values are defined inDesignChoiceConstants
, and they are:IMAGE_TYPE_IMAGE_JPEG
IMAGE_TYPE_IMAGE_BMP
IMAGE_TYPE_IMAGE_GIF
IMAGE_TYPE_IMAGE_PNG
IMAGE_TYPE_IMAGE_X_PNG
- Parameters:
type
- the type to set
-
getData
public byte[] getData(org.eclipse.birt.report.model.core.Module module) Returns the image data in Base64 encoding.- Parameters:
module
- the module of this structure- Returns:
- the image data
-
setData
public void setData(byte[] data) Sets the data of the image.- Parameters:
data
- the image data to set
-
handle
Description copied from class:org.eclipse.birt.report.model.core.Structure
Creates the specific handle of this structure. This handle is always created.- Specified by:
handle
in classorg.eclipse.birt.report.model.core.Structure
- Parameters:
valueHandle
- the value handle of this structure list property this structure is inindex
- the position of this structure in structure list- Returns:
- the handle of this structure.
-
validate
public List validate(org.eclipse.birt.report.model.core.Module module, org.eclipse.birt.report.model.core.DesignElement element) Description copied from class:org.eclipse.birt.report.model.core.Structure
Validate whether this structure is valid. The derived class should override this method if semantic check is needed. The each error is the instance ofPropertyValueException
.- Overrides:
validate
in classorg.eclipse.birt.report.model.core.ReferencableStructure
- Parameters:
module
- the moduleelement
- the element contains this structure- Returns:
- the semantic error list
-
isReferencableProperty
Description copied from class:org.eclipse.birt.report.model.core.ReferencableStructure
Checks whether the member of the input name is the referencable member or not.- Specified by:
isReferencableProperty
in classorg.eclipse.birt.report.model.core.ReferencableStructure
- Parameters:
memberName
- the member name to check- Returns:
- true if the member with the given name is referencable, otherwise false
-
getReferencableProperty
Description copied from class:org.eclipse.birt.report.model.core.Structure
Gets the value of the referencable member.- Overrides:
getReferencableProperty
in classorg.eclipse.birt.report.model.core.Structure
- Returns:
- the value of the referencable member
-