com.spotfire.ws.im.ds
Class MetadataItem

java.lang.Object
  extended by com.spotfire.ws.im.ds.MetadataItem

public class MetadataItem
extends Object

This object represents one level of data source metadata.

A MetadataItem is described with a type and a name and may have additional attributes.

The default item types are:

The column level has a 'data-type' attribute.

Since:
7.2

Field Summary
static String CATALOG
          The catalog type
static String COLUMN
          The column type
static String DATA_SOURCE
          The data-source type
static String DATA_TYPE_ATTR
          The data-type attribute
static String PROCEDURE
          The procedure type
static String PROCEDURE_COLUMN
          The procedure column type, NOTE: used in axis api only
static String SCHEMA
          The schema type
static String TABLE
          The table type
static String TABLE_ALIAS
          The table alias type
static String TABLE_REF_ATTR
          The table reference attribute
 
Constructor Summary
MetadataItem(String type, String name)
          Creates a new MetadataItem instance at a non-terminal level.
MetadataItem(String type, String name, boolean terminal)
          Creates a new MetadataItem instance.
 
Method Summary
static MetadataItem fromXML(Element e)
          Create a MetadataItem from an XML representation.
 String[] getAttributeNames()
          Returns an array of all attribute names.
 String getAttributeValue(String attr)
          Returns the value of a given attribute.
 String[] getAttributeValues()
          Returns an array of all attribute values.
 String getName()
          Returns the item name.
 String getType()
          Returns the item type.
 boolean isTerminal()
          Tells if this item represents a terminal level, i.e. contains no children.
 void setAttribute(String name, String value)
          Sets an attribute.
 String toString()
          Serializes this object for debug purposes.
 Element toXML()
          Returns the XML representation of this item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DATA_SOURCE

public static final String DATA_SOURCE
The data-source type

See Also:
Constant Field Values

CATALOG

public static final String CATALOG
The catalog type

See Also:
Constant Field Values

SCHEMA

public static final String SCHEMA
The schema type

See Also:
Constant Field Values

TABLE

public static final String TABLE
The table type

See Also:
Constant Field Values

TABLE_ALIAS

public static final String TABLE_ALIAS
The table alias type

See Also:
Constant Field Values

TABLE_REF_ATTR

public static final String TABLE_REF_ATTR
The table reference attribute

See Also:
Constant Field Values

PROCEDURE

public static final String PROCEDURE
The procedure type

See Also:
Constant Field Values

PROCEDURE_COLUMN

public static final String PROCEDURE_COLUMN
The procedure column type, NOTE: used in axis api only

See Also:
Constant Field Values

COLUMN

public static final String COLUMN
The column type

See Also:
Constant Field Values

DATA_TYPE_ATTR

public static final String DATA_TYPE_ATTR
The data-type attribute

See Also:
Constant Field Values
Constructor Detail

MetadataItem

public MetadataItem(String type,
                    String name)
Creates a new MetadataItem instance at a non-terminal level.

Parameters:
type - an item type
name - an item name

MetadataItem

public MetadataItem(String type,
                    String name,
                    boolean terminal)
Creates a new MetadataItem instance.

Parameters:
type - an item type
name - an item name
terminal - if true, this level contains no child items
Method Detail

getType

public String getType()
Returns the item type.

Returns:
an item type String

getName

public String getName()
Returns the item name.

Returns:
an item name String

isTerminal

public boolean isTerminal()
Tells if this item represents a terminal level, i.e. contains no children.

Returns:
true if item level is terminal, false otherwise

getAttributeNames

public String[] getAttributeNames()
Returns an array of all attribute names.

Returns:
a name String array

getAttributeValues

public String[] getAttributeValues()
Returns an array of all attribute values.

Returns:
a value String array

getAttributeValue

public String getAttributeValue(String attr)
Returns the value of a given attribute.

Parameters:
attr - an attribute name

setAttribute

public void setAttribute(String name,
                         String value)
Sets an attribute.

Parameters:
name - an attribute name
value - an attribute value

toXML

public Element toXML()
Returns the XML representation of this item.

Returns:
the XML representation of this item.
Throws:
XMLFormatException - if an error should occur when creating the XML.

fromXML

public static MetadataItem fromXML(Element e)
Create a MetadataItem from an XML representation.

Parameters:
e - the XML representation of a MetadataItem.
Returns:
the Metadata
Throws:
XMLParseException

toString

public String toString()
Serializes this object for debug purposes.

Overrides:
toString in class Object


Copyright © 2000-2009 TIBCO Software Inc. All Rights Reserved.