public class XPathUtil
extends java.lang.Object
For example,
type | examples |
element | /report/body/table[3] /library/components/grid/row[1]/cell[2]/label |
slot | /report/body /report/body/* /report/body/table/detail/row[slotName="cells"] |
property | /report/parameters/scalar-parameter[@id="2"]/@name /report/list-property[@name="images"] /report/body/text[@id="19"]/text-property[@name="content"] /report/body/text[@id="19"]/text-property[@name="content"]/@key |
structure (EmbeddedImageHandle/IncludedLibraryHandle/ResultSetColumnHandle) | /report/list-property[@name="images"]/structure[2] /report/list-property[@name="images"]/structure |
It is strongly recommended not to call
getInstance(ModuleHandle, String)
with manually created XPath
string. Much better to use XPath string returned by getXPath(Object)
.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
RESOURCE_KEY_SUFFIX
The suffix for the resource key.
|
static java.lang.String |
SLOT_NAME_PROPERTY
The attribute to indicate a slot name.
|
Constructor and Description |
---|
XPathUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.Object |
getInstance(ModuleHandle module,
java.lang.String xpath)
Returns the instance by the given XPath of
DesignElementHandle , SlotHandle ,
StructureHandle . |
static java.lang.String |
getXPath(java.lang.Object instance)
Returns the XPath of the given instance.
|
static java.lang.String |
getXPath(java.lang.Object instance,
int index)
Returns the script path of the given instance.
|
public static final java.lang.String SLOT_NAME_PROPERTY
public static final java.lang.String RESOURCE_KEY_SUFFIX
public static java.lang.String getXPath(java.lang.Object instance)
instance
- can be DesignElementHandle
,
SlotHandle
, StructureHandle
,
PropertyHandle
.public static java.lang.String getXPath(java.lang.Object instance, int index)
instance
- PropertyHandle
which type or sub type must be
expression or script.index
- of property should be in valid range. 0 basedpublic static java.lang.Object getInstance(ModuleHandle module, java.lang.String xpath)
DesignElementHandle
, SlotHandle
,
StructureHandle
.module
- the report/libraryxpath
- the XPath in stringDesignElementHandle
/SlotHandle
/
StructureHandle
.Copyright © 2008 Actuate Corp. All rights reserved.