|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.birt.report.model.api.ModuleUtil
public class ModuleUtil
Provides some tool methods about the modules.
Field Summary | |
---|---|
static int |
INVALID_MODULE
The invalid module. |
static int |
LIBRARY
The library type. |
static int |
REPORT_DESIGN
The report design type. |
Constructor Summary | |
---|---|
ModuleUtil()
|
Method Summary | |
---|---|
static int |
checkModule(SessionHandle sessionHandle,
java.lang.String fileName,
java.io.InputStream is)
Checks the input stream with given file name. |
static java.util.List |
checkVersion(java.lang.String fileName)
Checks whether the opening design file holds a version number before the some specific features is supported. |
static int |
compareReportVersion(java.lang.String version1,
java.lang.String version2)
Compares two specifies report version. |
static java.lang.String |
convertColumnTypeToParamType(java.lang.String type)
Convert column data type to param type. |
static java.lang.String |
convertParamTypeToColumnType(java.lang.String type)
Convert param type to column data type. |
static ActionHandle |
deserializeAction(java.io.InputStream streamData)
Deserialize an input stream into an Action. |
static ActionHandle |
deserializeAction(java.io.InputStream streamData,
DesignElementHandle element)
Deserialize an input stream into an Action. |
static ActionHandle |
deserializeAction(java.lang.String strData)
Deserializes a string into an ActionHandle, notice that the handle is faked, the action is not in the design tree, the operation to the handle is not able to be undone. |
static ActionHandle |
deserializeAction(java.lang.String strData,
DesignElementHandle element)
Deserialize a string into an ActionHandle, notice that the handle is faked, the action is not in the design tree, the operation to the handle is not able to be undoned. |
static long |
gerSerializedID(DesignElementHandle element)
Returns the serialized id for the given element. |
static java.lang.String |
getExternalizedValue(DesignElementHandle element,
java.lang.String key,
java.lang.String value,
com.ibm.icu.util.ULocale locale)
Returns externalized message for the given locale. |
static java.lang.String |
getReportVersion()
Gets the current version of the report files when users want to save it calling Model's related APIs. |
static java.lang.String |
getScript(ModuleHandle module,
java.lang.String uid)
Gets the script value. |
static java.lang.Object |
getScriptObject(ModuleHandle module,
java.lang.String uid)
Gets the script object . |
static java.lang.String |
getScriptUID(java.lang.Object instance)
Gets the script id if instance has expression. |
static java.lang.String |
getScriptUID(java.lang.Object instance,
int index)
Gets the script id if instance has expression. |
static boolean |
isEqualHierarchiesForJointCondition(HierarchyHandle conditionHierarchy,
HierarchyHandle cubeHierarchy)
This API is only for helping GUI to draw the dimension joint condition editor pad. |
static boolean |
isInclude(ModuleHandle moduleHandle,
java.lang.String fileName)
Checks whether a library with the specified file name is directly or indirectly included by the module. |
static boolean |
isListFilterValue(FilterConditionElementHandle filter)
Determine if the value1 of this filter condition is a list. |
static boolean |
isListFilterValue(FilterConditionHandle filter)
Determine if the value1 of this filter condition is a list. |
static boolean |
isListStyleRuleValue(StyleRuleHandle rule)
Determine if the value1 of this map rule condition is a list. |
static boolean |
isValidDesign(SessionHandle sessionHandle,
java.lang.String fileName,
java.io.InputStream is)
Justifies whether a given input stream is a valid report design. |
static boolean |
isValidElementName(DesignElementHandle elementHandle)
checks is the name value is valid for the design element. |
static boolean |
isValidElementName(DesignElementHandle elementHandle,
java.lang.String propName,
java.lang.String nameValue)
checks if the name of the element is valid. |
static boolean |
isValidLibrary(SessionHandle sessionHandle,
java.lang.String fileName,
java.io.InputStream is)
Justifies whether a library resource with the given file name is a valid library. |
static java.lang.String |
serializeAction(ActionHandle action)
Serialize an action into a stream, the stream is in UTF-8 encoding. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int LIBRARY
public static final int REPORT_DESIGN
public static final int INVALID_MODULE
Constructor Detail |
---|
public ModuleUtil()
Method Detail |
---|
public static ActionHandle deserializeAction(java.io.InputStream streamData) throws DesignFileException
streamData
- a stream represent an action.
DesignFileException
- if the exception occur when interpret the stream data.public static ActionHandle deserializeAction(java.io.InputStream streamData, DesignElementHandle element) throws DesignFileException
streamData
- a stream represent an action.element
-
DesignFileException
- if the exception occur when interpret the stream data.public static ActionHandle deserializeAction(java.lang.String strData) throws DesignFileException
strData
- a string represent an action.
DesignFileException
- if the exception occur when interpret the stream data.public static ActionHandle deserializeAction(java.lang.String strData, DesignElementHandle element) throws DesignFileException
strData
- a string represent an action.element
-
DesignFileException
- if the exception occur when interpret the stream data.public static java.lang.String serializeAction(ActionHandle action) throws java.io.IOException
action
- a given action structure.
java.io.IOException
- if I/O exception occur when writing the stream.public static boolean isValidDesign(SessionHandle sessionHandle, java.lang.String fileName, java.io.InputStream is)
sessionHandle
- the current session of the report designfileName
- the file name of the report designis
- the input stream of the report design
public static boolean isValidLibrary(SessionHandle sessionHandle, java.lang.String fileName, java.io.InputStream is)
sessionHandle
- the current session of the libraryfileName
- the file name of the libraryis
- the input stream of the library
public static int checkModule(SessionHandle sessionHandle, java.lang.String fileName, java.io.InputStream is)
ModuleUtil.REPORT_DESIGN
/
ModuleUtil.LIBRARY
, otherwise,
ModuleUtil.INVALID
is return.
sessionHandle
- the current session of the libraryfileName
- the file name of the libraryis
- the input stream of the library
ModuleUtil.REPORT_DESIGN
if the input stream is a
report design, ModuleUtil.LIBRARY
if the input
stream is a library, ModuleUtil.INVALID
otherwise.public static java.util.List checkVersion(java.lang.String fileName)
fileName
- the file name with full path of the design file
IVersionInfo
type. Each
kind of automatical conversion information is stored in one
instance of IVersionInfo
. Note that if the design
file does not exist, or it is an invalid design file, an instance
of IVersionInfo
will also generate. If the size of
the return list is 0, there is no auto-conversion.public static java.lang.String getExternalizedValue(DesignElementHandle element, java.lang.String key, java.lang.String value, com.ibm.icu.util.ULocale locale)
element
- the report element.key
- the display key property valuevalue
- the property valuelocale
- the locale
public static boolean isEqualHierarchiesForJointCondition(HierarchyHandle conditionHierarchy, HierarchyHandle cubeHierarchy)
conditionHierarchy
- the hierarchy handle from the dimension joint condition
structure.cubeHierarchy
- the hierarchy handle from the cube.
public static boolean isValidElementName(DesignElementHandle elementHandle, java.lang.String propName, java.lang.String nameValue)
elementHandle
- the design element need to be checked the name property value.propName
- the property name which is name property type of this design
element.nameValue
- the value of the name property.
public static boolean isValidElementName(DesignElementHandle elementHandle)
elementHandle
- element need to be checked for the name.nameValue
- name of the element.
public static boolean isListFilterValue(FilterConditionHandle filter)
filter
- the filter need to check
public static boolean isListStyleRuleValue(StyleRuleHandle rule)
rule
- the map rule need to check
public static boolean isListFilterValue(FilterConditionElementHandle filter)
filter
- the filter need to check
public static java.lang.String convertParamTypeToColumnType(java.lang.String type)
type
-
public static java.lang.String convertColumnTypeToParamType(java.lang.String type)
type
-
public static java.lang.String getScriptUID(java.lang.Object instance)
instance
- PropertyHandle
which type or sub type should be
script or expression.
public static java.lang.String getScriptUID(java.lang.Object instance, int index)
instance
- PropertyHandle
which type or sub type should be
script or expression.index
- index should be in valid range, should be more than zero and
less than list value size.
public static java.lang.String getScript(ModuleHandle module, java.lang.String uid)
module
- module handleuid
- the script uid
public static java.lang.Object getScriptObject(ModuleHandle module, java.lang.String uid)
module
- module handleuid
- the script uid
public static long gerSerializedID(DesignElementHandle element)
element
- the element
public static java.lang.String getReportVersion()
public static int compareReportVersion(java.lang.String version1, java.lang.String version2) throws java.lang.IllegalArgumentException
version1
- version2
-
java.lang.IllegalArgumentException
- thrown if either of the two given version string is illegalpublic static boolean isInclude(ModuleHandle moduleHandle, java.lang.String fileName)
moduleHandle
- the module handle which to include the libraryfileName
- the absolute file name of the library
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |