public abstract class API
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
BOOLEAN
Primitive property type values.
|
static java.lang.String |
CAT
The binary catalog file suffix.
|
static int |
CENTIMETER
The unit type value.
|
static int |
COLOR
Reference property type values.
|
static int |
DOUBLE
Primitive property type values.
|
static int |
ENUM
Reference property type values.
|
static int |
FLOAT
Primitive property type values.
|
static int |
INCH
The unit type value.
|
static int |
INTEGER
Primitive property type values.
|
static int |
LONG
Primitive property type values.
|
static int |
PIXEL
The unit type value.
|
static int |
REFERENCE
Reference property type values.
|
static java.lang.String |
RPT
The binary format report file suffix.
|
static java.lang.String |
SELFRPT
The binary self-contained report file suffix.
|
static int |
STRING
Reference property type values.
|
static java.lang.String |
TEXTRPT
The text format report file suffix.
|
static java.lang.String |
UNIFYRPT
The binary format web report file suffix.
|
static int |
UNKNOWN
Primitive property type values.
|
static java.lang.String |
WEBRPT
The binary format web report file suffix.
|
static java.lang.String |
XMLCAT
The XML format catalog file suffix.
|
static java.lang.String |
XMLRPT
The XML format report file suffix.
|
Constructor and Description |
---|
API() |
Modifier and Type | Method and Description |
---|---|
void |
clearError()
Clears error message.
|
void |
clearMsg()
Clears messages of warning and error.
|
void |
clearWarning()
Clears warning message.
|
void |
closeLog()
Closes log.
|
boolean |
containPropName(java.lang.String handle,
java.lang.String name)
Checks whether the property name is valid or not.
|
abstract boolean |
delete(java.lang.String handle)
Deletes an object from its parent node.
|
boolean |
getBool(java.lang.String handle,
java.lang.String name)
Gets property value.
|
java.lang.String[] |
getChildren(java.lang.String objHandle)
Gets the handles of all children of an object.
|
int |
getClassType(java.lang.String handle)
Gets the object type of an object.
|
java.awt.Color |
getColor(java.lang.String handle,
java.lang.String name)
Gets property value.
|
double |
getDouble(java.lang.String handle,
java.lang.String name)
Gets property value.
|
java.lang.String |
getError()
Gets error message.
|
float |
getFloat(java.lang.String handle,
java.lang.String name)
Gets property value.
|
java.lang.String[] |
getHandles()
Gets all handles of the objects of API.
|
java.lang.String[] |
getHandles(java.lang.String handle)
Gets children handles of the current node.
|
java.lang.String[] |
getHandles(java.lang.String handle,
int type)
Gets children handles which are of the same object type in the current node.
|
java.lang.String[] |
getHandles(java.lang.String handle,
int type,
int depth)
Gets children handles which are of the same object type.
|
java.lang.String |
getInstanceName(java.lang.String handle)
Gets the instance name of an object.
|
int |
getInt(java.lang.String handle,
java.lang.String name)
Gets property value.
|
long |
getLong(java.lang.String handle,
java.lang.String name)
Gets property value.
|
java.lang.String |
getParent(java.lang.String handle)
Gets the parent handle of an object.
|
double |
getPoint(java.lang.String handle,
java.lang.String name)
Gets property value.
|
java.lang.String[] |
getPropNames(java.lang.String handle)
Gets property names of all the objects.
|
int |
getPropType(java.lang.String handle,
java.lang.String name)
Gets the data type of the specified property of an object.
|
java.lang.String |
getQualifyName(java.lang.String handle)
Gets the qualified name of an object.
|
java.lang.String |
getString(java.lang.String handle,
java.lang.String name)
Gets
STRING , ENUM , REFERENCE type property value. |
java.lang.String[] |
getStringArray(java.lang.String handle,
java.lang.String name)
Gets String array if the property's value is a list.
|
int |
getUnit()
Gets the current unit setting.
|
java.lang.String |
getWarning()
Gets warning message.
|
boolean |
set(java.lang.String handle,
java.lang.String name,
boolean value)
Changes boolean type property value of an object.
|
boolean |
set(java.lang.String handle,
java.lang.String name,
java.awt.Color value)
Changes color type property value.
|
boolean |
set(java.lang.String handle,
java.lang.String name,
double value)
Changes double type property value of an object.
|
boolean |
set(java.lang.String handle,
java.lang.String name,
float value)
Changes float type property value of an object.
|
boolean |
set(java.lang.String handle,
java.lang.String name,
int value)
Changes int type property value of an object.
|
boolean |
set(java.lang.String handle,
java.lang.String name,
long value)
Changes long type property value of an object.
|
boolean |
set(java.lang.String handle,
java.lang.String name,
java.lang.String value)
Changes String type property value of an object.
|
boolean |
setLog(java.io.OutputStream log,
java.lang.String encoding)
Sets the API's error log to the specified OutputStream.
|
boolean |
setLog(java.lang.String fileName)
Sets the API's error log to a file.
|
boolean |
setLog(java.lang.String fileName,
boolean append)
Sets the API's error log to a file.
|
boolean |
setPoint(java.lang.String handle,
java.lang.String name,
double value)
Changes point number type property value of an object, such as
FontSize . |
boolean |
setReference(java.lang.String handle,
java.lang.String name,
java.lang.String refHandle)
Changes reference property value of an object.
|
boolean |
setUnit(int unit)
Sets unit for API usage.
|
void |
writeLog(java.lang.String msg)
Writes message to the log.
|
void |
writeLog(java.lang.String title,
java.lang.Throwable e)
Writes Throwable to the log.
|
public static final int UNKNOWN
public static final int BOOLEAN
public static final int INTEGER
public static final int LONG
public static final int FLOAT
public static final int DOUBLE
public static final int STRING
public static final int COLOR
public static final int ENUM
public static final int REFERENCE
public static final int INCH
public static final int CENTIMETER
public static final int PIXEL
public static final java.lang.String RPT
public static final java.lang.String WEBRPT
public static final java.lang.String XMLRPT
public static final java.lang.String SELFRPT
public static final java.lang.String TEXTRPT
public static final java.lang.String CAT
public static final java.lang.String XMLCAT
public static final java.lang.String UNIFYRPT
public boolean setUnit(int unit)
float
, double
values that users set to Logi Report internal unit.unit
- It must be either INCH
or CENTIMETER
.true
if the unit setting succeeded;false
otherwise.public int getUnit()
INCH
or CENTIMETER
.public abstract boolean delete(java.lang.String handle)
handle
- Handle of the object to be deleted.true
if an object is removed from its parent node; false
otherwise.public java.lang.String[] getPropNames(java.lang.String handle)
propertyName
and value
.handle
- Handle of the selected object.public boolean containPropName(java.lang.String handle, java.lang.String name)
handle
- Handle of the selected object.name
- The property name.true if it exists; false otherwise.
public int getPropType(java.lang.String handle, java.lang.String name)
handle
- Handle of the object.name
- Name of the property.BOOLEAN
- boolean value.
INTEGER
- int value.
LONG
- long value.
FLOAT
- float value.
DOUBLE
- double value.
STRING
- String value.
COLOR
- color value.
ENUM
- a list value.
REFERENCE
- Logi Report reference object.
public boolean set(java.lang.String handle, java.lang.String name, boolean value)
handle
- Handle of the target object.name
- Property name.value
- Property value.getPropType(String, String)
,
getBool(String, String)
public boolean set(java.lang.String handle, java.lang.String name, int value)
handle
- Handle of the target object.name
- Property name.value
- Property value.getPropType(String, String)
,
getInt(String, String)
public boolean set(java.lang.String handle, java.lang.String name, long value)
handle
- Handle of the target object.name
- Property name.value
- Property value.getPropType(String, String)
,
getLong(String, String)
public boolean set(java.lang.String handle, java.lang.String name, float value)
handle
- Handle of the target object.name
- Property name.value
- Property value.getPropType(String, String)
,
getFloat(String, String)
public boolean set(java.lang.String handle, java.lang.String name, double value)
handle
- Handle of the target object.name
- Property name.value
- Property value.getPropType(String, String)
,
getDouble(String, String)
public boolean set(java.lang.String handle, java.lang.String name, java.lang.String value)
handle
- Handle of the target object.name
- Property name.value
- Property value.getPropType(String, String)
,
getString(String, String)
public boolean set(java.lang.String handle, java.lang.String name, java.awt.Color value)
handle
- Handle of the target object.name
- Property name.value
- Color property value.getPropType(String, String)
,
getColor(String, String)
public boolean setReference(java.lang.String handle, java.lang.String name, java.lang.String refHandle)
handle
- Handle of the target object.name
- Property name.refHandle
- Handle of the referenced object.getPropType(String, String)
,
getString(String, String)
public boolean getBool(java.lang.String handle, java.lang.String name)
handle
- Handle of the target object.name
- Property name.getPropType(String, String)
,
set(String, String, boolean)
public int getInt(java.lang.String handle, java.lang.String name)
handle
- Handle of the target object.name
- Property name.getPropType(String, String)
,
set(String, String, int)
public long getLong(java.lang.String handle, java.lang.String name)
handle
- Handle of the target object.name
- Property name.getPropType(String, String)
,
set(String, String, long)
public float getFloat(java.lang.String handle, java.lang.String name)
handle
- Handle of the target object.name
- Property name.getPropType(String, String)
,
set(String, String, float)
public double getDouble(java.lang.String handle, java.lang.String name)
handle
- Handle of the target object.name
- Property name.getPropType(String, String)
,
set(String, String, double)
public double getPoint(java.lang.String handle, java.lang.String name)
handle
- Handle of the target object.name
- Property name.getPropType(String, String)
,
setPoint(String, String, double)
public java.lang.String getString(java.lang.String handle, java.lang.String name)
STRING
, ENUM
, REFERENCE
type property value.
After calling this method, you must immediately check the error message.
If the error message is not null, the return value will not be usable.handle
- Handle of the target object.name
- Property name.getPropType(String, String)
,
set(String, String, String)
public java.lang.String[] getStringArray(java.lang.String handle, java.lang.String name)
handle
- Handle of the target object.name
- Property name.getPropType(String, String)
,
set(String, String, String)
public java.awt.Color getColor(java.lang.String handle, java.lang.String name)
handle
- Handle of the target object.name
- The property name.getPropType(String, String)
,
set(String, String, Color)
public java.lang.String[] getHandles()
public java.lang.String[] getHandles(java.lang.String handle)
handle
- Parent node handle.public java.lang.String[] getHandles(java.lang.String handle, int type)
type
- Type value of the object.handle
- Parent node handle.getClassType(String)
public java.lang.String[] getHandles(java.lang.String handle, int type, int depth)
type
- Object type value that is defined in API class.handle
- Parent node handle.deepth
- level Depth related to the scan step to the current level in the report tree.
When the depth is -1, all the handles of the report will be returned.
When the depth is 0, the children handles of the current node will be returned.
When the depth is number n, the children handles of n levels and the current level will be returned.public java.lang.String getInstanceName(java.lang.String handle)
handle
- Handle of an object.null
if the handle is invalid.public java.lang.String getQualifyName(java.lang.String handle)
handle
- Handle of an object.null
if the handle is invalid.public int getClassType(java.lang.String handle)
handle
- Handle of the object.UNKNOWN
if the handle is invalid or the object is unsupported.public java.lang.String getParent(java.lang.String handle)
handle
- Handle of the object.null
if the handle is invalid, see getError()
; if the object is a root node, see getWarning()
.public java.lang.String getWarning()
public void clearWarning()
public java.lang.String getError()
null
, if the operation is executed successfully.public void clearError()
public void clearMsg()
public boolean setLog(java.io.OutputStream log, java.lang.String encoding)
log
- The output stream of log messages to be output.encoding
- Specifies the encoding of the log.true
if log creation succeeded; false
if #UnsupportedEncodingException is thrown.public boolean setLog(java.lang.String fileName, boolean append)
fileName
- The system-dependent file name,the output log file that the messages to be output.append
- If true
, then the messages will be written to the end of the file rather than the beginning.true
if log creation succeeded; false
if #FileNotFoundException is thrown.
If the file exists but it is a directory rather than a regular file, or it does not exist and cannot be created, or cannot be opened for any other reason, then a FileNotFoundException is thrown.public boolean setLog(java.lang.String fileName)
fileName
- The system-dependent file name,the output log file that messages to be output.true
if log creation succeeded;false
if #FileNotFoundException is thrown.
If the file exists but it is a directory rather than a regular file, or it does not exist and cannot be created, or cannot be opened for any other reason, then a FileNotFoundException is thrown.public void writeLog(java.lang.String msg)
msg
- The message to be output into the log.public void writeLog(java.lang.String title, java.lang.Throwable e)
title
- The title to be output into the log.e
- The Throwable to be output into the log.public void closeLog() throws java.io.IOException
java.io.IOException
public boolean setPoint(java.lang.String handle, java.lang.String name, double value)
FontSize
.handle
- Handle of the target object.name
- Property name.value
- Property value.getPropType(String, String)
,
#setPoint(String, String)
public java.lang.String[] getChildren(java.lang.String objHandle)
objHandle
- The handle of the objectgetHandles(String)