|
MetaTF API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--MetaTF.Parser.Section
Section
Record
,
Field
Fields inherited from interface MetaTF.Parser.HasFields |
cvsheader |
Fields inherited from interface MetaTF.Parser.HasProperties |
cvsheader |
Constructor Summary | |
(package private) |
Section(java.lang.String s,
int i)
Allocate a new object to represent asection |
(package private) |
Section(java.lang.String s,
int i,
boolean b)
Allocate a new object to represent asection |
(package private) |
Section(java.lang.String s,
int i,
boolean b,
int l)
Allocate a new object to represent asection |
Method Summary | |
java.lang.Object |
accept(DTDVisitor visitor,
java.lang.Object data)
Accept the visitor |
void |
addField(Field f)
Add a Field to this section Simply override old definitions (i.e. |
void |
addProperty(java.lang.String type,
java.lang.String fname,
java.lang.String p,
Value v,
int l)
Add a property to this section or record |
(package private) void |
addRecord(Record r)
Add a Record to this section |
(package private) void |
addRecordByTag(int tag,
Record r)
Add a Record to the list of 'records by tag' in this section |
int |
compareTo(java.lang.Object s)
Compare sections by number |
java.lang.String |
dump(java.lang.String prefix)
Dump a representation of this section |
java.util.Map |
getFields()
|
int |
getLine()
|
int |
getMaxTag()
|
java.lang.String |
getName()
|
int |
getNumber()
|
Value |
getProperty(java.lang.String fname,
java.lang.String p)
Get the valeue of the named property if the field is defined at the section level |
Record |
getRecord(int tag)
Get a record defined in this section |
Record |
getRecord(java.lang.String str)
Get a record defined in this section |
java.util.Map |
getRecords()
|
boolean |
hasRecord(int t)
Does this section define a record? |
boolean |
hasRecord(java.lang.String name)
Does this section define a record? |
boolean |
isCached()
|
Methods inherited from class java.lang.Object |
|
Constructor Detail |
Section(java.lang.String s, int i, boolean b, int l) throws DTDException
s
- the name of the sectioni
- the number of the sectionb
- is the section cached?the
- line in the DTD where this section's definition startedDTDException
- IF this section number or name is already usedSection(java.lang.String s, int i, boolean b) throws DTDException
s
- the name of the sectioni
- the number of the sectionb
- is the section cached?DTDException
- IF this section number is already usedSection(java.lang.String s, int i) throws DTDException
s
- the name of the sectionthe
- line in the DTD where this section's definition startedDTDException
- IF this section number is already usedMethod Detail |
void addRecord(Record r) throws DTDException
1. if a record of this name is known, remove it 2. do any macro replacement of field names 3. do semantic check on fields 4. finally, add record to section
r
- the record to addDTDException
- if this is improperpublic void addProperty(java.lang.String type, java.lang.String fname, java.lang.String p, Value v, int l) throws DTDException
HasProperties
addProperty
in interface HasProperties
MetaTF.Parser.HasProperties
type
- the typefield
- the name of the field. The property is only added if the field names matchproperty
- the propertyvalue
- the value of the propertybeginLine
- the line in the DTD at which this property was definedDTDException
- public Value getProperty(java.lang.String fname, java.lang.String p) throws DTDException
fname
- the name of the fieldp
- the propertyDTDException
- IF fname is not defined at the section level ||
fname does not have property ppublic void addField(Field f) throws DTDException
addField
in interface HasFields
f
- the field to addDTDException
- IF
f is neither a named not a tag field ||
the DTD doesn't contain this section(!!)void addRecordByTag(int tag, Record r) throws DTDException
tag
- the tagr
- the record to addDTDException
- IF a record of this tag has already been addedpublic Record getRecord(int tag) throws DTDException
tag
- the tag of the recordDTDException
- if this section does not contain a record with tag tagpublic Record getRecord(java.lang.String str) throws DTDException
str
- the name of the recordDTDException
- if this section does not contain a record named strpublic java.lang.String getName()
public int getNumber()
public java.util.Map getRecords()
public java.util.Map getFields()
public boolean hasRecord(java.lang.String name)
name
- the name of the recordpublic boolean hasRecord(int t)
t
- the tag of the recordpublic int getMaxTag()
public boolean isCached()
public int getLine()
public int compareTo(java.lang.Object s)
compareTo
in interface java.lang.Comparable
s
- the section to comparepublic java.lang.String dump(java.lang.String prefix)
prefix
- an identifying prefixpublic java.lang.Object accept(DTDVisitor visitor, java.lang.Object data)
|
MetaTF API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |