org.hydrateframework.gen.schema
Class Key
java.lang.Object
org.hydrateframework.gen.schema.SchemaElementBase
org.hydrateframework.gen.schema.Key
- All Implemented Interfaces:
- SchemaElement
- Direct Known Subclasses:
- Key
public class Key
- extends SchemaElementBase
- Version:
- @(#)$Revision: 1.9 $
- Author:
- David Chamberlin
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 |
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, finalize, getClass, notify, notifyAll, wait, wait, wait |
INT_KEY
public static final java.lang.String INT_KEY
- See Also:
- Constant Field Values
STR_KEY
public static final java.lang.String STR_KEY
- See Also:
- Constant Field Values
COMPLEX_KEY
public static final java.lang.String COMPLEX_KEY
- See Also:
- Constant Field Values
name
protected java.lang.String name
packageName
protected java.lang.String packageName
members
protected java.util.List<Member> members
strMembers
protected java.util.List<java.lang.String> strMembers
comment
protected java.lang.String comment
isPrimary
protected int isPrimary
Key
public Key(Family family,
ClassDef clsDef)
Key
public Key(Family family,
ClassDef clsDef,
boolean generatedDefaultKey)
Key
public Key(Family family,
Key override)
getOverrides
public SchemaElementBase getOverrides()
- Specified by:
getOverrides
in class SchemaElementBase
toSummary
public java.lang.String toSummary()
getOwningCls
public ClassDef getOwningCls()
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in class java.lang.Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
isPrimary
public boolean isPrimary()
isDisabled
public boolean isDisabled()
getComment
public java.lang.String getComment()
setName
public void setName(java.lang.String nm)
addMember
public void addMember(java.lang.String nm)
getMembers
public Member[] getMembers()
getMembers
public Member[] getMembers(Relationship.Reference asReference)
- Return a list of members that are needed to resolve a reference. These members
will include a discriminator if it is needed.
- Parameters:
asReference
-
- Returns:
getMembers
public Member[] getMembers(ClassDef referencedClassDef)
getJavaName
public java.lang.String getJavaName()
getFQJavaName
public java.lang.String getFQJavaName()
getName
public java.lang.String getName()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
getJavaVarName
public java.lang.String getJavaVarName()
containsMember
public boolean containsMember(Member member)
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
- 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.
writeAttrs
protected void writeAttrs(java.util.List<SAXWriter.Attr> attrs)
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
- Throws:
org.xml.sax.SAXException
getAllMemberNames
protected java.util.List<java.lang.String> getAllMemberNames()
resolve
public void resolve()
getKeyType
public java.lang.String getKeyType()
isValid
public boolean isValid(java.lang.StringBuffer reason)
- Description copied from interface:
SchemaElement
- Determine if the schema element just read is valid.
- 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
- 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.
- Parameters:
family
- the family in which the overridden element is to be created
- Returns:
- the new schema element that overrides this one.
shouldWrite
public boolean shouldWrite()
getHighlightType
public SchemaElement.HighlightType getHighlightType()
Copyright © 2000 The Hydrate Project. All Rights Reserved.