org.jboss.metatype.api.types
Class ImmutableTableMetaType

java.lang.Object
  extended by org.jboss.metatype.api.types.AbstractMetaType
      extended by org.jboss.metatype.api.types.ImmutableTableMetaType
All Implemented Interfaces:
Serializable, MetaType, TableMetaType

public class ImmutableTableMetaType
extends AbstractMetaType
implements TableMetaType

ImmutableTableMetaType.

Version:
$Revision: 1.1 $
Author:
Adrian Brock
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.jboss.metatype.api.types.MetaType
ALLOWED_CLASSNAMES
 
Constructor Summary
ImmutableTableMetaType(String typeName, String description, CompositeMetaType rowType, String[] indexNames)
          Construct a tabe type.
 
Method Summary
 boolean equals(Object obj)
           
 List<String> getIndexNames()
          Retrieve an unmodifiable list of index names in the same order as passed to the constructor.
 CompositeMetaType getRowType()
          Retrieve the row type
 int hashCode()
           
 boolean isTable()
          Retrieve whether the class name of the type is a table
 boolean isValue(Object obj)
          Whether the passed value is one of those described by this meta type.
 String toString()
           
 
Methods inherited from class org.jboss.metatype.api.types.AbstractMetaType
getClassName, getDescription, getTypeName, isArray, isCollection, isComposite, isEnum, isGeneric, isPrimitive, isProperties, isSimple
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.metatype.api.types.MetaType
getClassName, getDescription, getTypeName, isArray, isCollection, isComposite, isEnum, isGeneric, isPrimitive, isProperties, isSimple
 

Constructor Detail

ImmutableTableMetaType

public ImmutableTableMetaType(String typeName,
                              String description,
                              CompositeMetaType rowType,
                              String[] indexNames)
Construct a tabe type. The parameters are checked for validity.

Parameters:
typeName - the name of the tabular type, cannot be null or empty
description - the human readable description of the tabular type, cannot be null or empty
rowType - the type of the row elements in the tabular data, cannot be null
indexNames - the names of the item values that uniquely index each row element in the tabular data, cannot be null or empty. Each element must be an item name in the rowType, nul or empty is not allowed. The order of the item names in this parameter is used by TableValue.get(org.jboss.metatype.api.values.MetaValue[]) and TableValue.remove(org.jboss.metatype.api.values.MetaValue[]) the TabularValue to match the array of values to items.
Throws:
IllegalArgumentException - when a parameter does not match what is described above or when an element of indexNames is not defined in rowType.
Method Detail

getRowType

public CompositeMetaType getRowType()
Description copied from interface: TableMetaType
Retrieve the row type

Specified by:
getRowType in interface TableMetaType
Returns:
the row type

getIndexNames

public List<String> getIndexNames()
Description copied from interface: TableMetaType
Retrieve an unmodifiable list of index names in the same order as passed to the constructor.

Specified by:
getIndexNames in interface TableMetaType
Returns:
the index names

isTable

public boolean isTable()
Description copied from interface: MetaType
Retrieve whether the class name of the type is a table

Specified by:
isTable in interface MetaType
Overrides:
isTable in class AbstractMetaType
Returns:
true when it is a table or false otherwise

isValue

public boolean isValue(Object obj)
Description copied from interface: MetaType
Whether the passed value is one of those described by this meta type.

Specified by:
isValue in interface MetaType
Specified by:
isValue in class AbstractMetaType
Parameters:
obj - the object to test
Returns:
true when it is value for this meta type, false otherwise

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.