|
MetaTF API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--MetaTF.Parser.Field | +--MetaTF.Parser.NamedField
Named field
Field
Fields inherited from class MetaTF.Parser.Field |
beginLine |
Fields inherited from interface MetaTF.Parser.HasFields |
cvsheader |
Constructor Summary | |
(package private) |
NamedField(java.lang.String s)
Allocate a new object representing a named field |
(package private) |
NamedField(java.lang.String s,
int l)
Allocate a new object representing a named field |
(package private) |
NamedField(java.lang.String t,
java.lang.String s,
java.lang.String p,
Value v)
Allocate a new object representing a named field |
(package private) |
NamedField(java.lang.String t,
java.lang.String s,
java.lang.String p,
Value v,
int l)
Allocate a new object representing a named field |
Method Summary | |
java.lang.Object |
accept(DTDVisitor visitor,
java.lang.Object data)
Accept the visitor |
void |
addField(Field f)
Add a subfield to this field |
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 |
addProperty(java.lang.String p,
Value v,
int l)
Add property p=v to this field |
(package private) void |
checkFields()
Check that this field is well formed. |
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()
|
java.util.Map |
getProperties()
|
Value |
getProperty(java.lang.String name)
|
int |
getTag()
Get the tag of this field |
java.lang.String |
getType()
|
java.lang.String |
getType(java.lang.String fname)
Get the type of the field if it matches the name given |
boolean |
hasProperty(java.lang.String name)
Does this field have a given property? |
boolean |
isTagged()
Is this field tagged? |
(package private) 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 |
|
Constructor Detail |
NamedField(java.lang.String t, java.lang.String s, java.lang.String p, Value v, int l)
t
- the types
- the name of the fieldp
- the propertyv
- the valuel
- the line in the DTD at which this field was definedNamedField(java.lang.String t, java.lang.String s, java.lang.String p, Value v)
t
- the types
- the name of the fieldp
- the propertyv
- the valueNamedField(java.lang.String s, int l)
s
- the name of the fieldl
- the line in the DTD at which this field was definedNamedField(java.lang.String s)
s
- the name of the fieldMethod Detail |
public java.lang.String getName()
getName
in class Field
MetaTF.Parser.Field
public java.util.Map getProperties()
Value
public boolean hasProperty(java.lang.String name)
name
- the namepublic Value getProperty(java.lang.String name)
name
- the name of the propertyValue
Field replaceFields(java.util.Map inheritedRecords0, java.util.Map inheritedRecords, java.util.Map inheritedFields)
Field
replaceFields
in class Field
MetaTF.Parser.Field
inheritedRecords0
- Map inheritedRecords
- Map inheritedFields
- Map void checkFields() throws DTDException
type==string --> value is none or defaultAll macro substition must be done before checkFields is calledtype==index --> value is sectionOffset, sectionStride or default otherwise --> the type may not be sectionOffset, sectionStride, default or a number
checkFields
in class Field
DTDException
- IF this field is not well-formedreplaceFields(java.util.Map, java.util.Map, java.util.Map)
public boolean containsField(java.lang.String s)
Field
containsField
in class Field
MetaTF.Parser.Field
s
- the name of the subfieldpublic void addProperty(java.lang.String p, Value v, int l) throws DTDException
public boolean addProperty(java.lang.String type, java.lang.String field, java.lang.String property, Value value, int l) throws DTDException
addProperty
in class Field
type
- the typefield
- the name of the field. The property is only added if the field names matchproperty
- the property (default 'encoding')value
- the value of the propertybeginLine
- the line in the DTD at which this property was definedDTDException
- IF
1. this field already has this property defined 2. the type is already set 3. the type is string but the value is not defaultor none the type is index but the value is not sectionOffset, sectionStride or default otherwise, if the value is sectionOffset, sectionStride, default or a number
public void addField(Field f)
Field
addField
in class Field
MetaTF.Parser.Field
f
- the subfieldpublic int getNumNamedFields()
getNumNamedFields
in class Field
MetaTF.Parser.Field
public int getTag() throws NoTagException
getTag
in class Field
NoTagException
- ALWAYSpublic boolean isTagged()
Field
isTagged
in class Field
MetaTF.Parser.Field
public java.lang.String getType()
getType
in class Field
MetaTF.Parser.Field
public java.lang.String getType(java.lang.String fname)
fname
- the name of the field whose type is requiredpublic java.lang.String dump(java.lang.String prefix)
Field
dump
in class Field
MetaTF.Parser.Field
public java.lang.Object accept(DTDVisitor visitor, java.lang.Object data)
Field
accept
in class Field
|
MetaTF API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |