MetaTF API

MetaTF.Parser
Class Field

java.lang.Object
  |
  +--MetaTF.Parser.Field
All Implemented Interfaces:
HasFields
Direct Known Subclasses:
NamedField, RepeatField, TagField, TupleField

public abstract class Field
extends java.lang.Object
implements HasFields

Abstract field (part of the symbol table) children are tagField, NamedField, RepeatField, TupleField

Version:
rel-1-2 ($Revision: 1.3 $, $Date: 2000/12/15 16:29:55 $),
Author:
Richard Jones
See Also:
The MetaTF Grammar, TagField, NamedField, RepeatField, TupleField

Field Summary
protected  int beginLine
          The line in the DTD where this field was defined
 
Fields inherited from interface MetaTF.Parser.HasFields
cvsheader
 
Constructor Summary
(package private) Field()
           
 
Method Summary
abstract  java.lang.Object accept(DTDVisitor visitor, java.lang.Object data)
          Accept the visitor
abstract  void addField(Field f)
          Add a subfield to this field
(package private) abstract  boolean addProperty(java.lang.String type, java.lang.String field, java.lang.String property, Value value, int beginLine)
          Add a property to this field
(package private) abstract  void checkFields()
          Check that this field is well formed i.e.
abstract  boolean containsField(java.lang.String s)
          Does this field contain a named subfield?
abstract  java.lang.String dump(java.lang.String prefix)
          Dump this field
abstract  java.lang.String getName()
           
abstract  int getNumNamedFields()
           
abstract  int getTag()
          Get the tag of this field
abstract  java.lang.String getType()
           
abstract  boolean isTagged()
          Is this field tagged?
(package private) abstract  Field replaceFields(java.util.Map inheritedRecords0, java.util.Map inheritedRecords, java.util.Map inheritedFields)
          Do a macro replacement of any fields that do not have properties defined locally.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

beginLine

protected int beginLine
The line in the DTD where this field was defined
Constructor Detail

Field

Field()
Method Detail

containsField

public abstract boolean containsField(java.lang.String s)
Does this field contain a named subfield?
Parameters:
s - the name of the subfield
Returns:
whether this field contains a subfield named s

addField

public abstract void addField(Field f)
Add a subfield to this field
Specified by:
addField in interface HasFields
Parameters:
f - the subfield

replaceFields

abstract Field replaceFields(java.util.Map inheritedRecords0,
                             java.util.Map inheritedRecords,
                             java.util.Map inheritedFields)
Do a macro replacement of any fields that do not have properties defined locally.
Parameters:
inheritedRecords0 - Map of records inherited from section 0
inheritedRecords - Map of records inherited from this section
inheritedFields - Map of inherited fields
Returns:
the modified field

checkFields

abstract void checkFields()
                   throws DTDException
Check that this field is well formed i.e. has a type and an encoding. All macro substition must be done before checkFields is called
Throws:
DTDException - IF this field is not well-formed
See Also:
replaceFields(java.util.Map, java.util.Map, java.util.Map)

addProperty

abstract boolean addProperty(java.lang.String type,
                             java.lang.String field,
                             java.lang.String property,
                             Value value,
                             int beginLine)
                      throws DTDException
Add a property to this field
Parameters:
type - the type
field - the name of the field. The property is only added if the field names match
property - the property
value - the value of the property
beginLine - the line in the DTD at which this property was defined
Throws:
DTDException -  

getNumNamedFields

public abstract int getNumNamedFields()
Returns:
the number of named subfields of this field

getTag

public abstract int getTag()
                    throws NoTagException
Get the tag of this field
Returns:
the tag, if any
Throws:
NoTagException - IF this field does not contain a tag

isTagged

public abstract boolean isTagged()
Is this field tagged?
Returns:
whether the field is tagged

getName

public abstract java.lang.String getName()
Returns:
the name of the field

getType

public abstract java.lang.String getType()
Returns:
the type of the field

dump

public abstract java.lang.String dump(java.lang.String prefix)
Dump this field
Returns:
a prettified representation of this field

accept

public abstract java.lang.Object accept(DTDVisitor visitor,
                                        java.lang.Object data)
Accept the visitor

MetaTF API

Copyright © 2001 - Richard Jones     MetaTF