org.hydrateframework.gen.schema
Class Enumeration

java.lang.Object
  extended by org.hydrateframework.gen.schema.SchemaElementBase
      extended by org.hydrateframework.gen.schema.Enumeration
All Implemented Interfaces:
SchemaElement, Type
Direct Known Subclasses:
Enumeration

public class Enumeration
extends SchemaElementBase
implements Type

Version:
@(#)$Revision: 1.8 $
Author:
David Chamberlin

Nested Class Summary
static class Enumeration.Option
           
 
Nested classes/interfaces inherited from interface org.hydrateframework.gen.schema.SchemaElement
SchemaElement.HighlightType
 
Field Summary
protected  java.lang.String codeMethod
           
protected  Type type
           
 
Fields inherited from class org.hydrateframework.gen.schema.SchemaElementBase
ATTR_MANDATORY, ATTR_MANDATORYNOOVR, ATTR_NOOVR, ATTR_OPTIONAL, ATTR_OPTIONALNOOVR, BOOL_FALSE, BOOL_NOT, BOOL_NOTSET, BOOL_TRUE, NAME, valid
 
Constructor Summary
Enumeration(Family family)
           
Enumeration(Family family, Enumeration override)
           
 
Method Summary
 java.lang.String getComment()
           
 Family getFamily()
           
 SchemaElement.HighlightType getHighlightType()
           
 java.lang.String getJavaEmptyValue()
           
 java.lang.String getJavaNativeType()
           
 java.lang.String getJavaNotPopulatedValue()
           
 java.lang.String getJavaNotSetValue()
           
 java.lang.String getJavaPackageName()
           
 java.lang.String getJavaPublicType()
           
 java.lang.String getJavaSqlType()
           
 java.lang.String getJavaTypeName()
          The java type name is now the name of the Enumeration and not the name of the sqlValue.
 int getLength()
           
 java.lang.String getName()
          The language independent name of this type
 java.util.Collection<Enumeration.Option> getOptions()
           
 SchemaElementBase getOverrides()
           
 int getPrecision()
           
 int getScale()
           
 java.lang.String getSQLTypeName(SQLWriter sqlWriter)
           
 java.lang.String getSQLTypeName(SQLWriter sqlWriter, int size, int precision, int scale)
           
 java.lang.String getTablespace()
           
 Type getType()
           
 java.lang.String getXSDTypeName(boolean isOptional)
           
 boolean isValid(java.lang.StringBuffer reason)
          Determine if the schema element just read is valid.
 int maxDisplayLen()
           
 void notifyUpdate(SchemaElement element)
          Notify a schema element that the schema element it is overriding has changed
 SchemaElement override(Family family)
          Override the schema element from ain included file.
 java.lang.Object parseType(java.lang.String val)
           
 boolean readFromXmlDoc(java.util.Stack<java.lang.String> readContext, org.w3c.dom.Element elem)
          Read the element from the DOM model
 void resolve()
           
 void setName(java.lang.String name)
           
 void setType(java.lang.String type)
           
 boolean shouldWrite()
           
 java.lang.String toSummary()
           
 java.lang.String writeAsString(java.lang.String var)
           
 java.lang.String writeCompareTwo(java.lang.String one, java.lang.String two)
           
 java.lang.String writeCvtFromJavaObj(java.lang.String obj)
           
 java.lang.String writeCvtInternalToPublic(java.lang.String var)
           
 java.lang.String writeCvtPublicToInternal(java.lang.String var)
           
 java.lang.String writeFromString(java.lang.String var)
           
 java.lang.String writeHashCode(java.lang.String var)
           
 java.lang.String writeJavaSqlRead(java.lang.String rs, java.lang.String mbrIdx)
           
 java.lang.String writeJavaSqlSet(java.lang.String stmt, java.lang.String mbrIdx, java.lang.String mbrVar)
           
 java.lang.String writeJavaSqlUpdate(java.lang.String rs, java.lang.String mbrIdx, java.lang.String mbrVar)
           
 void writeToXmlDoc(SAXWriter wrt)
          Write out this schema element to the SAX Handler
 java.lang.String writeUpdFromUnderlying(java.lang.String var)
           
 void writeXSDType(SAXWriter wrt, boolean isOptional)
           
 
Methods inherited from class org.hydrateframework.gen.schema.SchemaElementBase
addBoolAttribute, addEnumAttribute, addIntAttribute, addListAttribute, addStringAttribute, isValidIdentifier, newElement, printAttrWarning, printWarning, readBoolAttribute, readEnumAttribute, readIntAttribute, readListAttribute, readStringAttribute, refEquals, supersedes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

codeMethod

protected java.lang.String codeMethod

type

protected Type type
Constructor Detail

Enumeration

public Enumeration(Family family)

Enumeration

public Enumeration(Family family,
                   Enumeration override)
Method Detail

getOverrides

public SchemaElementBase getOverrides()
Specified by:
getOverrides in class SchemaElementBase

toSummary

public java.lang.String toSummary()
Specified by:
toSummary in interface SchemaElement

getOptions

public java.util.Collection<Enumeration.Option> getOptions()

getTablespace

public java.lang.String getTablespace()

setType

public void setType(java.lang.String type)

getJavaPackageName

public java.lang.String getJavaPackageName()

getFamily

public Family getFamily()

getJavaTypeName

public java.lang.String getJavaTypeName()
The java type name is now the name of the Enumeration and not the name of the sqlValue. This is to ensure that the owning implementation class will have an instance of the Enumeration type.

Specified by:
getJavaTypeName in interface Type

getJavaPublicType

public java.lang.String getJavaPublicType()
Specified by:
getJavaPublicType in interface Type

getJavaNotSetValue

public java.lang.String getJavaNotSetValue()
Specified by:
getJavaNotSetValue in interface Type

getJavaNotPopulatedValue

public java.lang.String getJavaNotPopulatedValue()
Specified by:
getJavaNotPopulatedValue in interface Type

getJavaNativeType

public java.lang.String getJavaNativeType()
Specified by:
getJavaNativeType in interface Type

getJavaEmptyValue

public java.lang.String getJavaEmptyValue()
Specified by:
getJavaEmptyValue in interface Type

getJavaSqlType

public java.lang.String getJavaSqlType()
Specified by:
getJavaSqlType in interface Type

writeJavaSqlUpdate

public java.lang.String writeJavaSqlUpdate(java.lang.String rs,
                                           java.lang.String mbrIdx,
                                           java.lang.String mbrVar)
Specified by:
writeJavaSqlUpdate in interface Type

writeJavaSqlRead

public java.lang.String writeJavaSqlRead(java.lang.String rs,
                                         java.lang.String mbrIdx)
Specified by:
writeJavaSqlRead in interface Type

writeCvtFromJavaObj

public java.lang.String writeCvtFromJavaObj(java.lang.String obj)
Specified by:
writeCvtFromJavaObj in interface Type

writeCvtInternalToPublic

public java.lang.String writeCvtInternalToPublic(java.lang.String var)
Specified by:
writeCvtInternalToPublic in interface Type

writeCvtPublicToInternal

public java.lang.String writeCvtPublicToInternal(java.lang.String var)
Specified by:
writeCvtPublicToInternal in interface Type

writeToXmlDoc

public void writeToXmlDoc(SAXWriter wrt)
                   throws org.xml.sax.SAXException
Description copied from interface: SchemaElement
Write out this schema element to the SAX Handler

Specified by:
writeToXmlDoc in interface SchemaElement
Throws:
org.xml.sax.SAXException

getComment

public java.lang.String getComment()

getType

public Type getType()

readFromXmlDoc

public boolean readFromXmlDoc(java.util.Stack<java.lang.String> readContext,
                              org.w3c.dom.Element elem)
Description copied from interface: SchemaElement
Read the element from the DOM model

Specified by:
readFromXmlDoc in interface SchemaElement
Parameters:
readContext - the context within the XML of the read operation. This is used to help pinpoint the source of an error.
elem - the DOM element to use to initialize this class.

setName

public void setName(java.lang.String name)

getName

public java.lang.String getName()
Description copied from interface: Type
The language independent name of this type

Specified by:
getName in interface SchemaElement
Specified by:
getName in interface Type

getLength

public int getLength()
Specified by:
getLength in interface Type

getPrecision

public int getPrecision()
Specified by:
getPrecision in interface Type

getScale

public int getScale()
Specified by:
getScale in interface Type

parseType

public java.lang.Object parseType(java.lang.String val)
                           throws java.text.ParseException
Specified by:
parseType in interface Type
Throws:
java.text.ParseException

writeAsString

public java.lang.String writeAsString(java.lang.String var)
Specified by:
writeAsString in interface Type

writeFromString

public java.lang.String writeFromString(java.lang.String var)
Specified by:
writeFromString in interface Type

getSQLTypeName

public java.lang.String getSQLTypeName(SQLWriter sqlWriter)

getSQLTypeName

public java.lang.String getSQLTypeName(SQLWriter sqlWriter,
                                       int size,
                                       int precision,
                                       int scale)
Specified by:
getSQLTypeName in interface Type

writeJavaSqlSet

public java.lang.String writeJavaSqlSet(java.lang.String stmt,
                                        java.lang.String mbrIdx,
                                        java.lang.String mbrVar)
Specified by:
writeJavaSqlSet in interface Type

writeHashCode

public java.lang.String writeHashCode(java.lang.String var)
Specified by:
writeHashCode in interface Type

writeUpdFromUnderlying

public java.lang.String writeUpdFromUnderlying(java.lang.String var)
Specified by:
writeUpdFromUnderlying in interface Type

getXSDTypeName

public java.lang.String getXSDTypeName(boolean isOptional)
Specified by:
getXSDTypeName in interface Type

writeCompareTwo

public java.lang.String writeCompareTwo(java.lang.String one,
                                        java.lang.String two)
Specified by:
writeCompareTwo in interface Type

writeXSDType

public void writeXSDType(SAXWriter wrt,
                         boolean isOptional)
                  throws org.xml.sax.SAXException
Specified by:
writeXSDType in interface Type
Throws:
org.xml.sax.SAXException

isValid

public boolean isValid(java.lang.StringBuffer reason)
Description copied from interface: SchemaElement
Determine if the schema element just read is valid.

Specified by:
isValid in interface SchemaElement
Parameters:
reason - the reason for the failure (or warning) if any should be appended to this string buffer.
Returns:
true if the element is valid, false otherwise.

notifyUpdate

public void notifyUpdate(SchemaElement element)
Description copied from interface: SchemaElement
Notify a schema element that the schema element it is overriding has changed

Specified by:
notifyUpdate in interface SchemaElement
Parameters:
element - the overridden schema element.

override

public SchemaElement override(Family family)
Description copied from interface: SchemaElement
Override the schema element from ain included file. The implementation of this method should make a new SchemaElement, that knows that it is overriding this element. It should also remember the identity of the schema element that has overridden it (i.e. the element it returns so that it can notify it via the SchemaElement.notifyUpdate(SchemaElement) method when this element changes.

Specified by:
override in interface SchemaElement
Parameters:
family - the family in which the overridden element is to be created
Returns:
the new schema element that overrides this one.

maxDisplayLen

public int maxDisplayLen()

shouldWrite

public boolean shouldWrite()
Specified by:
shouldWrite in interface SchemaElement

resolve

public void resolve()
Specified by:
resolve in interface SchemaElement

getHighlightType

public SchemaElement.HighlightType getHighlightType()
Specified by:
getHighlightType in interface SchemaElement


Copyright © 2000 The Hydrate Project. All Rights Reserved.