anvil.annot
Class NodeSpec

java.lang.Object
  |
  +--anvil.annot.NodeSpec
Direct Known Subclasses:
ContainerSpec, GroupSpec

public abstract class NodeSpec
extends java.lang.Object

Specification for group/track node (abstract parent class).


Field Summary
protected  java.util.HashSet attDisplay
           
protected  java.util.LinkedList attributes
           
protected  java.util.Hashtable attributeSpecs
           
 java.lang.String doc
          Contains documentation string which is used for the automated manual generation.
protected  boolean editTakeover
           
 java.lang.String name
          Name of the track/group.
protected  GroupSpec parent
           
protected  java.util.LinkedList reciLinkAtt
           
protected  AnnotationSpec spec
           
 
Constructor Summary
NodeSpec(GroupSpec parent, java.lang.String name)
           
 
Method Summary
 void addAttrDoc(java.lang.String attrName, java.lang.String doc)
           
 void addAttribute(AttributeSpec as)
          Adds attribute specification to this specification.
 ValueType addAvSpec(java.lang.String attrName, java.util.List values, boolean display, boolean useEmpty)
          Adds AV specification for an attribute and a list of possible value types.
 ValueType addAvSpec(java.lang.String attrName, java.lang.String valuetype, boolean display, boolean useEmpty)
           
 void addDefault(java.lang.String attname, java.lang.String defval)
          Adding default value for an attribute.
 boolean attrDocExists(java.lang.String name)
           
 void createHtmlFile(java.io.File dir)
           
 java.lang.String docString()
           
abstract  NodeSpec findSpec(java.lang.String name)
          Looks recursively through this node and all subs and returns the spec objects as soon as found.
abstract  java.util.List findTrackNames()
          Returns list of all track names in the subtree of this node.
 java.lang.String fullName()
          Returns full name, e.g.
 AnnotationSpec getAnnotationSpec()
           
 java.lang.String getAttrDoc(java.lang.String name)
          Returns doc string for attribute .
 java.util.List getAttributeNames()
          Returns a sorted view on attribute names.
 AttributeSpec getAttributeSpec(java.lang.String name)
           
 ValueType getAttributeType(java.lang.String attrName)
          Returns value type (object) of an attribute.
 java.lang.String getDefault(java.lang.String attname)
          Returns default value for one attribute of null.
 java.util.AbstractSet getDisplayedAttributes()
          Returns set of attributes that are to be displayed on annotation board.
 java.lang.String getHtmlFilename()
           
 java.lang.String getHtmlRefString()
           
 java.lang.String getName()
          Returns name of node (*not* full path!!!).
 GroupSpec getParent()
           
 java.util.List getReciprocalLinkAttributes()
           
 boolean isAttribute(java.lang.String att)
          Checks whether string is an attribute of this track.
 boolean isDisplayed(java.lang.String name)
          Returns true if the attribute is to be displayed on annotation board.
abstract  boolean isRoot()
           
 void removeAttribute(java.lang.String name)
           
 void setDisplayed(java.lang.String name, boolean val)
          Sets attribute display value.
 void setDisplayedAttributes(java.util.AbstractSet set)
           
 void setEditTakeover(boolean val)
           
 java.lang.String toString()
           
 boolean usesEditTakeover()
           
 void writeHtmlNavbar(kipp.io.MyBufferedWriter f)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

public java.lang.String name
Name of the track/group. Note that this is not the full name.


doc

public java.lang.String doc
Contains documentation string which is used for the automated manual generation.


parent

protected GroupSpec parent

spec

protected AnnotationSpec spec

editTakeover

protected boolean editTakeover

attributeSpecs

protected java.util.Hashtable attributeSpecs

attributes

protected java.util.LinkedList attributes

reciLinkAtt

protected java.util.LinkedList reciLinkAtt

attDisplay

protected java.util.HashSet attDisplay
Constructor Detail

NodeSpec

public NodeSpec(GroupSpec parent,
                java.lang.String name)
Method Detail

getAnnotationSpec

public AnnotationSpec getAnnotationSpec()

isRoot

public abstract boolean isRoot()

getAttributeNames

public java.util.List getAttributeNames()
Returns a sorted view on attribute names.


getReciprocalLinkAttributes

public java.util.List getReciprocalLinkAttributes()

setEditTakeover

public void setEditTakeover(boolean val)

usesEditTakeover

public boolean usesEditTakeover()

isAttribute

public boolean isAttribute(java.lang.String att)
Checks whether string is an attribute of this track.


getParent

public GroupSpec getParent()

getName

public java.lang.String getName()
Returns name of node (*not* full path!!!).


fullName

public java.lang.String fullName()
Returns full name, e.g. "ling.rst" or "gesture.deictic"


findTrackNames

public abstract java.util.List findTrackNames()
Returns list of all track names in the subtree of this node.


findSpec

public abstract NodeSpec findSpec(java.lang.String name)
Looks recursively through this node and all subs and returns the spec objects as soon as found. Or null otherwise.


getAttributeSpec

public AttributeSpec getAttributeSpec(java.lang.String name)
                               throws NoSuchAttributeException
NoSuchAttributeException

addDefault

public void addDefault(java.lang.String attname,
                       java.lang.String defval)
                throws AnnotationSpecException
Adding default value for an attribute.

AnnotationSpecException

getDefault

public java.lang.String getDefault(java.lang.String attname)
                            throws NoSuchAttributeException
Returns default value for one attribute of null.

NoSuchAttributeException

isDisplayed

public boolean isDisplayed(java.lang.String name)
                    throws NoSuchAttributeException
Returns true if the attribute is to be displayed on annotation board.

NoSuchAttributeException

setDisplayed

public void setDisplayed(java.lang.String name,
                         boolean val)
                  throws NoSuchAttributeException
Sets attribute display value.

NoSuchAttributeException

getDisplayedAttributes

public java.util.AbstractSet getDisplayedAttributes()
Returns set of attributes that are to be displayed on annotation board.


setDisplayedAttributes

public void setDisplayedAttributes(java.util.AbstractSet set)

getHtmlRefString

public java.lang.String getHtmlRefString()

writeHtmlNavbar

public void writeHtmlNavbar(kipp.io.MyBufferedWriter f)
                     throws java.io.IOException
java.io.IOException

addAttribute

public void addAttribute(AttributeSpec as)
                  throws AnnotationSpecException
Adds attribute specification to this specification.

AnnotationSpecException

addAttrDoc

public void addAttrDoc(java.lang.String attrName,
                       java.lang.String doc)
                throws NoSuchAttributeException
NoSuchAttributeException

getAttributeType

public ValueType getAttributeType(java.lang.String attrName)
                           throws NoSuchAttributeException
Returns value type (object) of an attribute.

NoSuchAttributeException

docString

public java.lang.String docString()

addAvSpec

public ValueType addAvSpec(java.lang.String attrName,
                           java.util.List values,
                           boolean display,
                           boolean useEmpty)
                    throws AnnotationSpecException
Adds AV specification for an attribute and a list of possible value types.

Parameters:
attrName - attribute name
values - list of values (ValueSpec objects)
display - true if attribute is to be displayed on annot. board
Returns:
value type object that was created.
AnnotationSpecException

removeAttribute

public void removeAttribute(java.lang.String name)

addAvSpec

public ValueType addAvSpec(java.lang.String attrName,
                           java.lang.String valuetype,
                           boolean display,
                           boolean useEmpty)
                    throws AnnotationSpecException
AnnotationSpecException

getAttrDoc

public java.lang.String getAttrDoc(java.lang.String name)
                            throws NoSuchAttributeException
Returns doc string for attribute .

NoSuchAttributeException

attrDocExists

public boolean attrDocExists(java.lang.String name)
                      throws NoSuchAttributeException
NoSuchAttributeException

getHtmlFilename

public java.lang.String getHtmlFilename()

createHtmlFile

public void createHtmlFile(java.io.File dir)
                    throws java.io.IOException
java.io.IOException

toString

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