org.apache.derby.catalog.types
Class UserDefinedTypeIdImpl

java.lang.Object
  extended by org.apache.derby.catalog.types.BaseTypeIdImpl
      extended by org.apache.derby.catalog.types.UserDefinedTypeIdImpl
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, Formatable, TypedFormat

public class UserDefinedTypeIdImpl
extends BaseTypeIdImpl

This type id describes a user defined type. There are 2 kinds of user defined types in Derby:

See Also:
Serialized Form

Field Summary
protected  java.lang.String className
          This class implements Formatable.
 
Fields inherited from class org.apache.derby.catalog.types.BaseTypeIdImpl
JDBCTypeId, schemaName, unqualifiedName
 
Constructor Summary
UserDefinedTypeIdImpl()
          Public niladic constructor.
UserDefinedTypeIdImpl(java.lang.String className)
          Constructor for a UserDefinedTypeIdImpl.
UserDefinedTypeIdImpl(java.lang.String schemaName, java.lang.String unqualifiedName, java.lang.String className)
          Constructor for a UDT.
 
Method Summary
 java.lang.String getClassName()
          Return the java class name for this type
 int getTypeFormatId()
          Get the formatID which corresponds to this class.
 boolean isBound()
          Has this user type been bound?
 void readExternal(java.io.ObjectInput in)
          Read this object from a stream of stored objects.
 boolean userType()
          Does this type id represent a user type?
 void writeExternal(java.io.ObjectOutput out)
          Write this object to a stream of stored objects.
 
Methods inherited from class org.apache.derby.catalog.types.BaseTypeIdImpl
equals, getJDBCTypeId, getSchemaName, getSQLTypeName, getUnqualifiedName, hashCode, isAnsiUDT, toParsableString, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

className

protected java.lang.String className
This class implements Formatable. That means that it can write itself to and from a formatted stream. If you add more fields to this class, make sure that you also write/read them with the writeExternal()/readExternal() methods. If, inbetween releases, you add more fields to this class, then you should bump the version number emitted by the getTypeFormatId() method.

Constructor Detail

UserDefinedTypeIdImpl

public UserDefinedTypeIdImpl()
Public niladic constructor. Needed for Formatable interface to work.


UserDefinedTypeIdImpl

public UserDefinedTypeIdImpl(java.lang.String className)
                      throws StandardException
Constructor for a UserDefinedTypeIdImpl. The SQLTypeName of a UserDefinedType is assumed to be its className for Derby-only UserDefinedTypes. For actual user created UDTs, the SQLTypeName is a schema qualified name.

Parameters:
className - The SQL name of the type
Throws:
StandardException

UserDefinedTypeIdImpl

public UserDefinedTypeIdImpl(java.lang.String schemaName,
                             java.lang.String unqualifiedName,
                             java.lang.String className)
Constructor for a UDT.

Parameters:
schemaName - Schema that the UDT lives in.
unqualifiedName - The name of the type inside that schema.
className - The Java class bound to the SQL type.
Method Detail

getClassName

public java.lang.String getClassName()
Return the java class name for this type


userType

public boolean userType()
Does this type id represent a user type?

Overrides:
userType in class BaseTypeIdImpl

isBound

public boolean isBound()
Has this user type been bound?


readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Read this object from a stream of stored objects.

Specified by:
readExternal in interface java.io.Externalizable
Overrides:
readExternal in class BaseTypeIdImpl
Parameters:
in - read this.
Throws:
java.io.IOException - thrown on error
java.lang.ClassNotFoundException - thrown on error

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Write this object to a stream of stored objects.

Specified by:
writeExternal in interface java.io.Externalizable
Overrides:
writeExternal in class BaseTypeIdImpl
Parameters:
out - write bytes here.
Throws:
java.io.IOException - thrown on error

getTypeFormatId

public int getTypeFormatId()
Get the formatID which corresponds to this class.

Specified by:
getTypeFormatId in interface TypedFormat
Overrides:
getTypeFormatId in class BaseTypeIdImpl
Returns:
the formatID of this class

Built on Thu 2012-03-29 21:53:33+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.