MetaTF API

MetaTF.Parser
Class RepeatField

java.lang.Object
  |
  +--MetaTF.Parser.Field
        |
        +--MetaTF.Parser.RepeatField
All Implemented Interfaces:
HasFields

public class RepeatField
extends Field

Repeat field

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

Fields inherited from class MetaTF.Parser.Field
beginLine
 
Fields inherited from interface MetaTF.Parser.HasFields
cvsheader
 
Constructor Summary
(package private) RepeatField()
           
 
Method Summary
 java.lang.Object accept(DTDVisitor visitor, java.lang.Object data)
          Accept the visitor
 void addField(Field f)
          Add a field.
(package private)  void addField(TupleField f)
           
 boolean addProperty(java.lang.String type, java.lang.String field, java.lang.String property, Value value, int l)
          Add a property to this field
 void checkFields()
          Check that this field is well formed i.e.
 boolean containsField(java.lang.String s)
          Does this field contain a named subfield?
 java.lang.String dump(java.lang.String prefix)
          Dump this field
 java.lang.String getName()
           
 int getNumNamedFields()
           
 NamedField getRepeat()
           
 Field getRepeatable()
           
 int getTag()
          Get the tag of this field
 java.lang.String getType()
           
 boolean isTagged()
          Is this field tagged?
 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
 

Constructor Detail

RepeatField

RepeatField()
Method Detail

addField

public void addField(Field f)
Add a field. This field is the repeat (if not set), in which case it must be a NamedField else it is the field to be repeated (if not set). It is an error if both fields already assigned. public only because it is an interface method
Overrides:
addField in class Field
Parameters:
f - the field to be added

addField

void addField(TupleField f)

getRepeat

public NamedField getRepeat()
Returns:
the repeat field

getRepeatable

public Field getRepeatable()
Returns:
the repeated field

replaceFields

public Field replaceFields(java.util.Map inheritedRecords0,
                           java.util.Map inheritedRecords,
                           java.util.Map inheritedFields)
Description copied from class: Field
Do a macro replacement of any fields that do not have properties defined locally.
Overrides:
replaceFields in class Field
Following copied from class: MetaTF.Parser.Field
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

public void checkFields()
                 throws DTDException
Description copied from class: Field
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
Overrides:
checkFields in class Field
Following copied from class: MetaTF.Parser.Field
Throws:
DTDException - IF this field is not well-formed
See Also:
Field.replaceFields(java.util.Map, java.util.Map, java.util.Map)

containsField

public boolean containsField(java.lang.String s)
Description copied from class: Field
Does this field contain a named subfield?
Overrides:
containsField in class Field
Following copied from class: MetaTF.Parser.Field
Parameters:
s - the name of the subfield
Returns:
whether this field contains a subfield named s

addProperty

public boolean addProperty(java.lang.String type,
                           java.lang.String field,
                           java.lang.String property,
                           Value value,
                           int l)
                    throws DTDException
Description copied from class: Field
Add a property to this field
Overrides:
addProperty in class Field
Following copied from class: MetaTF.Parser.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 int getNumNamedFields()
Overrides:
getNumNamedFields in class Field
Following copied from class: MetaTF.Parser.Field
Returns:
the number of named subfields of this field

getTag

public int getTag()
           throws NoTagException
Get the tag of this field
Overrides:
getTag in class Field
Throws:
NoTagException - ALWAYS

isTagged

public boolean isTagged()
Description copied from class: Field
Is this field tagged?
Overrides:
isTagged in class Field
Following copied from class: MetaTF.Parser.Field
Returns:
whether the field is tagged

getName

public java.lang.String getName()
Overrides:
getName in class Field
Following copied from class: MetaTF.Parser.Field
Returns:
the name of the field

getType

public java.lang.String getType()
Overrides:
getType in class Field
Following copied from class: MetaTF.Parser.Field
Returns:
the type of the field

dump

public java.lang.String dump(java.lang.String prefix)
Description copied from class: Field
Dump this field
Overrides:
dump in class Field
Following copied from class: MetaTF.Parser.Field
Returns:
a prettified representation of this field

accept

public java.lang.Object accept(DTDVisitor visitor,
                               java.lang.Object data)
Description copied from class: Field
Accept the visitor
Overrides:
accept in class Field

MetaTF API

Copyright © 2001 - Richard Jones     MetaTF