org.hydrateframework.gen.schema
Class ClassDef

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

public class ClassDef
extends SchemaElementBase
implements Type

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

Nested Class Summary
static class ClassDef.ShowType
           
 
Nested classes/interfaces inherited from interface org.hydrateframework.gen.schema.SchemaElement
SchemaElement.HighlightType
 
Field Summary
protected  java.lang.String comment
           
protected  java.lang.String discriminator
           
protected  java.lang.String javaClassName
           
protected  java.util.List<Key> keys
           
protected  java.util.List<Member> members
           
protected  java.lang.String name
           
protected  java.lang.String strSuperClass
           
protected  java.lang.String tablespace
           
 
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
ClassDef(Family family)
           
ClassDef(Family family, ClassDef override)
           
 
Method Summary
protected  void addKey(Key k)
           
protected  void addMember(Member m)
           
protected  void addMethod(Method m)
           
 Key findKey(java.lang.String name)
           
 Key[] getAllKeys()
           
 Member[] getAllMembers()
           
 Method[] getAllMethods()
           
 java.util.Collection<ClassDef> getAllSubclasses()
           
 java.util.Collection<ClassDef> getAllSuperclasses()
           
 ClassDef getBaseClass()
           
 java.lang.String getComment()
           
 ClassComparator[] getComparators()
           
 java.lang.String getDataService()
           
 java.lang.String getDiscriminator()
           
 Family getFamily()
           
 SchemaElement.HighlightType getHighlightType()
           
 java.lang.String[] getInterfaces()
           
 java.lang.String getJavaClsName()
           
 java.lang.String getJavaEmptyValue()
           
 java.lang.String getJavaFQClsName()
           
 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 name of the type in Java.
 Key[] getKeys()
           
 int getLength()
           
 Member[] getMembers()
           
 Method[] getMethods()
           
 java.lang.String getName()
          The language independent name of this type
 SchemaElementBase getOverrides()
           
 java.awt.Point getPosition()
           
 ClassDef[] getPossibleImplementations()
           
 int getPrecision()
           
 Key getPrimaryKey()
           
 int getScale()
           
 ClassDef.ShowType getShowState()
           
 java.lang.String getSQLTypeName(SQLWriter sqlWriter, int size, int precision, int scale)
           
 java.util.Collection<ClassDef> getSubclasses()
           
 ClassDef getSuperClass()
           
 java.lang.String getTablespace()
           
 java.lang.String getXSDTypeName(boolean isOptional)
           
 boolean isAbstract()
           
 boolean isInUse(int inContext)
           
 boolean isNoPersist()
           
 boolean isSuperClass(ClassDef sup, boolean includeInterfaces)
           
 boolean isValid(java.lang.StringBuffer reason)
          Determine if the schema element just read is valid.
 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)
           
protected  void readAttrs(java.util.Stack<java.lang.String> readContext, org.w3c.dom.Element elem)
           
 boolean readFromXmlDoc(java.util.Stack<java.lang.String> readContext, org.w3c.dom.Element elem)
          Read the element from the DOM model
protected  void removeMember(Member m)
           
 void resolve()
           
 void setPosition(java.awt.Point pnt)
           
 void setSuperClass(ClassDef superClass)
           
 boolean shouldWrite()
           
 void toggleShowState()
           
 java.lang.String toString()
           
 java.lang.String toSummary()
           
 java.lang.String writeAsString(java.lang.String var)
           
protected  void writeAttrs(java.util.List<SAXWriter.Attr> classDefAttrs)
           
 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, wait, wait, wait
 

Field Detail

strSuperClass

protected java.lang.String strSuperClass

tablespace

protected java.lang.String tablespace

discriminator

protected java.lang.String discriminator

comment

protected java.lang.String comment

name

protected java.lang.String name

javaClassName

protected java.lang.String javaClassName

members

protected java.util.List<Member> members

keys

protected java.util.List<Key> keys
Constructor Detail

ClassDef

public ClassDef(Family family,
                ClassDef override)

ClassDef

public ClassDef(Family family)
Method Detail

getOverrides

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

toSummary

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

getJavaPackageName

public java.lang.String getJavaPackageName()

getJavaFQClsName

public java.lang.String getJavaFQClsName()

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.

isInUse

public boolean isInUse(int inContext)

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.

isAbstract

public boolean isAbstract()

isNoPersist

public boolean isNoPersist()

getTablespace

public java.lang.String getTablespace()

getJavaEmptyValue

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

getJavaTypeName

public java.lang.String getJavaTypeName()
Description copied from interface: Type
The name of the type in Java. e.g. java.util.Date

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

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

getXSDTypeName

public java.lang.String getXSDTypeName(boolean isOptional)
Specified by:
getXSDTypeName 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

writeCompareTwo

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

getSuperClass

public ClassDef getSuperClass()

getComment

public java.lang.String getComment()

getFamily

public Family getFamily()

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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getJavaClsName

public java.lang.String getJavaClsName()

getInterfaces

public java.lang.String[] getInterfaces()

getMembers

public Member[] getMembers()

getAllMembers

public Member[] getAllMembers()

getAllMethods

public Method[] getAllMethods()

getSubclasses

public java.util.Collection<ClassDef> getSubclasses()

getAllSubclasses

public java.util.Collection<ClassDef> getAllSubclasses()

getAllSuperclasses

public java.util.Collection<ClassDef> getAllSuperclasses()

getMethods

public Method[] getMethods()

addMember

protected void addMember(Member m)

addMethod

protected void addMethod(Method m)

addKey

protected void addKey(Key k)

removeMember

protected void removeMember(Member m)

getPrimaryKey

public Key getPrimaryKey()

findKey

public Key findKey(java.lang.String name)

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

getAllKeys

public Key[] getAllKeys()

getKeys

public Key[] getKeys()

getComparators

public ClassComparator[] getComparators()

getBaseClass

public ClassDef getBaseClass()

setSuperClass

public void setSuperClass(ClassDef superClass)

getDiscriminator

public java.lang.String getDiscriminator()

isSuperClass

public boolean isSuperClass(ClassDef sup,
                            boolean includeInterfaces)

setPosition

public void setPosition(java.awt.Point pnt)

toggleShowState

public void toggleShowState()

getShowState

public ClassDef.ShowType getShowState()

getPosition

public java.awt.Point getPosition()

shouldWrite

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

writeAttrs

protected void writeAttrs(java.util.List<SAXWriter.Attr> classDefAttrs)

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

readAttrs

protected void readAttrs(java.util.Stack<java.lang.String> readContext,
                         org.w3c.dom.Element elem)

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.

getPossibleImplementations

public ClassDef[] getPossibleImplementations()

resolve

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

getDataService

public java.lang.String getDataService()

parseType

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

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,
                                       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

getHighlightType

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


Copyright © 2000 The Hydrate Project. All Rights Reserved.