|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sourceforge.nite.gui.util.ElementToTextDelegate
public class ElementToTextDelegate
An ElementToTextDelegate returns a String for any NOMElement passed to it. There are three ways the delegate determines this String. In order of preference these are:
TranscriptionToTextDelegate - setTranscriptionToTextDelegate(TranscriptionToTextDelegate)TranscriptionToTextDelegate.getTextForTranscriptionElement(NOMElement)setTranscriptionAttribute(String)NOMElement.getText() will be returned. This is the default.
| Constructor Summary | |
|---|---|
ElementToTextDelegate()
Construct a default delegate that will return the text content of an element. |
|
ElementToTextDelegate(java.lang.String transcriptionAttribute)
Create a new ElementToTextDelegate using a specified attribute. |
|
ElementToTextDelegate(TranscriptionToTextDelegate transToTextDelegate)
Create a new ElementToTextDelegate from a custom TranscriptionToTextDelegate. |
|
| Method Summary | |
|---|---|
java.lang.String |
getTranscriptionAttribute()
See the documentation of the method setTranscriptionToTextDelegate |
java.lang.String |
getTranscriptionText(NOMElement nme)
This method returns the transcript text of a certain transcription element. |
void |
setTranscriptionAttribute(java.lang.String newName)
See the documentation of the method setTranscriptionToTextDelegate |
void |
setTranscriptionToTextDelegate(TranscriptionToTextDelegate newDelegate)
There are three ways to determine the text that should be used to represent a certain element tle from the transcription layer. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ElementToTextDelegate()
public ElementToTextDelegate(TranscriptionToTextDelegate transToTextDelegate)
transToTextDelegate - the custom delegate to usepublic ElementToTextDelegate(java.lang.String transcriptionAttribute)
transcriptionAttribute - | Method Detail |
|---|
public void setTranscriptionToTextDelegate(TranscriptionToTextDelegate newDelegate)
tle from the transcription layer.
The one with the highest precedence is the TranscriptionToTextDelegate. If this parameter is set,
the text for element tle is determined by a call to
getTextForTranscriptionElement.
The one with the second-highest precedence is the parameter transcriptionAttribute.
If there is no TranscriptionToTextDelegate set, and this parameter is non-null, the text for
element tle is determined by the value of attribute 'transcriptionAttribute' of
that element.
If both above parameters are not set, the text representation of element tle
is taken to be the text content of the element.
In order to make the text of a transcription element available independent of these different
styles of derivation the method getTranscriptionText(net.sourceforge.nite.nom.nomwrite.NOMElement) is used.
public void setTranscriptionAttribute(java.lang.String newName)
setTranscriptionToTextDelegate
public java.lang.String getTranscriptionAttribute()
setTranscriptionToTextDelegate
public java.lang.String getTranscriptionText(NOMElement nme)
transcriptionAttribute for information on how that text is derived.
This method should be used whenever the text content for a certain transcription element is needed.
nme - The NOMElement containing transcription data.
java.lang.IllegalArgumentException - If called with wrong TYPE of element (not in transcription layer),
an IllegalArgumentException is thrown.
java.util.NoSuchElementException - : If the given element does not contain the right attribute
transcriptionAttribute when that attribute is needed, a NoSuchElementException is thrown.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||