Style Intelligence v12.0

inetsoft.uql.schema
Class XSchema

java.lang.Object
  extended by inetsoft.uql.schema.XSchema
All Implemented Interfaces:
Serializable

public class XSchema
extends Object
implements Serializable

XSchema is a schema parser. It parses a XML representation of a schema, and create one or more type nodes. It is used internally to parse data meta data.

See Also:
Serialized Form

Field Summary
static String BOOLEAN
          Boolean type.
static String BYTE
          Byte type.
static String CHAR
          Character type.
static String CHARACTER
          Character type.
static String COLOR
          Color type.
static String DATE
          Date type.
static String DECIMAL
          Decimal type.
static String DOUBLE
          Double type.
static String ENUM
          Enum type.
static String FLOAT
          Float type.
static String INTEGER
          Integer type.
static String LONG
          Long type.
static String NULL
          Null type.
static String ROLE
          Role type.
static String SHORT
          Short type.
static String STRING
          String type.
static String TIME
          Time type.
static String TIME_INSTANT
          Time instant type.
static String UNKNOWN
          Unknown type.
static String USER
          User type.
static String USER_DEFINED
          User defined type.
 
Constructor Summary
XSchema(Element root)
          Create a schema parser.
 
Method Summary
static XTypeNode createPrimitiveType(String type)
          Create the type node for the specified primitive type.
static XTypeNode createPrimitiveType(String name, Class cls)
          Create primitive type node from a java class.
 XTypeNode createTypeNode(String type)
          Create the type node for the specified type.
static XValueNode createValueNode(String type)
          Create a subclass of the XValueNode for the specified type.
 XTypeNode getTypeNode(String type)
          Get the type node (type definition) of the specified type.
static boolean isDateType(String type)
          Check if is a date type.
static boolean isNumericType(String type)
          Check if is a numeric type.
static boolean isPrimitiveType(String type)
          Check if the specified type is the primitive type.
static String mergeNumericType(String type1, String type2)
          Merge two numeric types.
 void writeXML(PrintWriter writer)
          Write the types in XML format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL

public static final String NULL
Null type.

See Also:
Constant Field Values

STRING

public static final String STRING
String type.

See Also:
Constant Field Values

BOOLEAN

public static final String BOOLEAN
Boolean type.

See Also:
Constant Field Values

FLOAT

public static final String FLOAT
Float type.

See Also:
Constant Field Values

DOUBLE

public static final String DOUBLE
Double type.

See Also:
Constant Field Values

DECIMAL

public static final String DECIMAL
Decimal type.

See Also:
Constant Field Values

CHAR

public static final String CHAR
Character type.

See Also:
Constant Field Values

CHARACTER

public static final String CHARACTER
Character type.

See Also:
Constant Field Values

BYTE

public static final String BYTE
Byte type.

See Also:
Constant Field Values

SHORT

public static final String SHORT
Short type.

See Also:
Constant Field Values

INTEGER

public static final String INTEGER
Integer type.

See Also:
Constant Field Values

LONG

public static final String LONG
Long type.

See Also:
Constant Field Values

TIME_INSTANT

public static final String TIME_INSTANT
Time instant type.

See Also:
Constant Field Values

DATE

public static final String DATE
Date type.

See Also:
Constant Field Values

TIME

public static final String TIME
Time type.

See Also:
Constant Field Values

ENUM

public static final String ENUM
Enum type.

See Also:
Constant Field Values

USER_DEFINED

public static final String USER_DEFINED
User defined type.

See Also:
Constant Field Values

ROLE

public static final String ROLE
Role type.

See Also:
Constant Field Values

USER

public static final String USER
User type.

See Also:
Constant Field Values

COLOR

public static final String COLOR
Color type.

See Also:
Constant Field Values

UNKNOWN

public static final String UNKNOWN
Unknown type.

See Also:
Constant Field Values
Constructor Detail

XSchema

public XSchema(Element root)
Create a schema parser.

Parameters:
root - XML root of the schema definition.
Method Detail

isNumericType

public static boolean isNumericType(String type)
Check if is a numeric type.

Parameters:
type - the specified data type.
Returns:
true if numeric, false otherwise.

isDateType

public static boolean isDateType(String type)
Check if is a date type.

Parameters:
type - the specified data type.
Returns:
true if date, false otherwise.

mergeNumericType

public static String mergeNumericType(String type1,
                                      String type2)
Merge two numeric types.

Parameters:
type1 - the specified numeric type a.
type2 - the specified numeric type b.
Returns:
the merged numeric type.

getTypeNode

public XTypeNode getTypeNode(String type)
Get the type node (type definition) of the specified type.

Parameters:
type - type name.
Returns:
type definition.

writeXML

public void writeXML(PrintWriter writer)
Write the types in XML format.


isPrimitiveType

public static boolean isPrimitiveType(String type)
Check if the specified type is the primitive type.


createPrimitiveType

public static XTypeNode createPrimitiveType(String type)
Create the type node for the specified primitive type.


createTypeNode

public XTypeNode createTypeNode(String type)
Create the type node for the specified type.


createValueNode

public static XValueNode createValueNode(String type)
Create a subclass of the XValueNode for the specified type.

Parameters:
type - one of the type constant.

createPrimitiveType

public static XTypeNode createPrimitiveType(String name,
                                            Class cls)
Create primitive type node from a java class.

Parameters:
name - the specfied name.
cls - the specified java class.
Returns:
corresponding primitive type node.

Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.