public abstract class AbstractTypeDescriptor
extends Object
SenseQueryDialog
,
charger.xml.CGXParser
,
charger.wn.WordnetTypeDescriptor
Modifier and Type | Field and Description |
---|---|
protected String |
definition
A text definition, possibly including examples, variants, etc.
|
protected String |
eol
Convenience for the toXML methods
|
protected String |
label
The actual term to which this descriptor applies
|
static String[] |
legalPartsOfSpeech
the list of available parts of speech.
|
protected String |
partofspeech
The part of speech.
|
protected static String |
tagName |
protected boolean |
validated
Whether this type descriptor has been tested or analyzed with respect to
some dictionary, etc.
|
Constructor and Description |
---|
AbstractTypeDescriptor() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(AbstractTypeDescriptor d)
Compares two type descriptors for equality.
|
String |
getDefinition()
Gets the definition string that is being represented by this descriptor.
|
static AbstractTypeDescriptor |
getInstanceFromXML(org.xml.sax.Attributes attrs)
Parses the XML parms that go along with the tag in getTagName().
|
String |
getLabel()
Gets the type descriptor's term label.
|
String |
getPOS()
Gets the part of speech string that is being represented by this
descriptor.
|
static String |
getTagName()
Gives the tag name that will be used by XML to represent this descriptor
|
String |
getTrimmedString()
Shorten the definition so it won't overrun windows and dialogs.
|
boolean |
isValidated()
Whether this type descriptor has been validated or not.
|
void |
setDefinition(String def)
Sets the definition of this type descriptor, without validation.
|
void |
setLabel(String lab)
Sets the type descriptor's term label.
|
boolean |
setValidated(boolean b)
Sets whether this type descriptor is validated or not.
|
abstract String |
toXML(String indent)
Translates the descriptor into its self-contained XML version.
|
protected static String tagName
protected String eol
protected String label
protected String definition
protected String partofspeech
TypeDescriptor#legalPartsOfSpeech
public static String[] legalPartsOfSpeech
protected boolean validated
public void setDefinition(String def)
public String getDefinition()
public String getPOS()
public boolean isValidated()
public void setLabel(String lab)
lab
- the term label to be assigned to this descriptor.public String getLabel()
public boolean setValidated(boolean b)
true
. Default is to return the value passed in by the callerb
- if true
, then perform whatever validation procedure
will be required; otherwise just invalidate the descriptor.public static String getTagName()
public abstract String toXML(String indent)
indent
- For convenience, what is the current indentation prefix?public static AbstractTypeDescriptor getInstanceFromXML(org.xml.sax.Attributes attrs)
attrs
- the Attributes passed to org.xml.sax.startElementcharger.xml.CGXParser
public String getTrimmedString()
public boolean equals(AbstractTypeDescriptor d)
d
- Descriptor to be compared.