Package net.sf.okapi.lib.xliff2.glossary
Class GlossEntry
- java.lang.Object
-
- net.sf.okapi.lib.xliff2.glossary.GlossEntry
-
- All Implemented Interfaces:
Iterable<Translation>
,IWithExtAttributes
,IWithExtElements
public class GlossEntry extends Object implements IWithExtAttributes, IWithExtElements, Iterable<Translation>
Represents the <glossEntry> element of the Glossary module.
-
-
Constructor Summary
Constructors Constructor Description GlossEntry()
Creates a newGlossEntry
object.GlossEntry(GlossEntry original)
Copy constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Translation
addTranslation(String text)
Adds a translation to this entry.Definition
getDefinition()
Gets the definition for this entry.ExtAttributes
getExtAttributes()
Gets theExtAttributes
object for the parent object.String
getExtAttributeValue(String namespaceURI, String localName)
Gets the value for a given extension attribute.ExtElements
getExtElements()
Gets theExtElements
object associated with this object.String
getId()
Gets the id for this entry.String
getRef()
Gets the reference for this entry.Term
getTerm()
Gets the term for this entry.List<Translation>
getTranslations()
Gets the list of theTranslation
objects for this entry.boolean
hasExtAttribute()
Indicates if at least one extension attribute is present.boolean
hasExtElements()
Indicates if there is aExtElements
object associated with this object.Iterator<Translation>
iterator()
Definition
setDefinition(Definition definition)
Sets a new definition for this entry.void
setExtAttributes(ExtAttributes attributes)
Sets theExtAttributes
object associated with this object.ExtElements
setExtElements(ExtElements elements)
Sets theExtElements
object associated with this object.void
setId(String id)
Sets the id for this entry.void
setRef(String ref)
Sets the reference for this entry.Term
setTerm(Term term)
Sets a new term for this entry.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
GlossEntry
public GlossEntry()
Creates a newGlossEntry
object.
-
GlossEntry
public GlossEntry(GlossEntry original)
Copy constructor.- Parameters:
original
- the original object to duplicate.
-
-
Method Detail
-
getId
public String getId()
Gets the id for this entry.- Returns:
- the id for this entry (can be null).
-
setId
public void setId(String id)
Sets the id for this entry.- Parameters:
id
- the new id for this entry (can be null).
-
getRef
public String getRef()
Gets the reference for this entry.- Returns:
- the reference for this entry (can be null).
-
setRef
public void setRef(String ref)
Sets the reference for this entry.- Parameters:
ref
- the new reference for this entry (can be null).
-
getTerm
public Term getTerm()
Gets the term for this entry.- Returns:
- the term for this entry.
-
setTerm
public Term setTerm(Term term)
Sets a new term for this entry.- Parameters:
term
- the new term for this entry (must not be null).- Returns:
- the new
Term
object.
-
getDefinition
public Definition getDefinition()
Gets the definition for this entry.- Returns:
- the definition for this entry (can be null).
-
setDefinition
public Definition setDefinition(Definition definition)
Sets a new definition for this entry.- Parameters:
definition
- the new definition for this entry (can be null).- Returns:
- the new
Definition
object.
-
addTranslation
public Translation addTranslation(String text)
Adds a translation to this entry.- Parameters:
text
- the text of the translation to add.- Returns:
- the new
Translation
object.
-
getExtElements
public ExtElements getExtElements()
Description copied from interface:IWithExtElements
Gets theExtElements
object associated with this object. If none exists one is created.- Specified by:
getExtElements
in interfaceIWithExtElements
- Returns:
- the
ExtElements
object associated with this object. If none exists one is created.
-
hasExtElements
public boolean hasExtElements()
Description copied from interface:IWithExtElements
Indicates if there is aExtElements
object associated with this object.- Specified by:
hasExtElements
in interfaceIWithExtElements
- Returns:
- true if there is a
ExtElements
object associated with this object, false otherwise.
-
setExtElements
public ExtElements setExtElements(ExtElements elements)
Description copied from interface:IWithExtElements
Sets theExtElements
object associated with this object.- Specified by:
setExtElements
in interfaceIWithExtElements
- Parameters:
elements
- theExtElements
object associated with this object. If null, a newExtElements
object is created.- Returns:
- the
ExtElements
object associated with this object, never null.
-
setExtAttributes
public void setExtAttributes(ExtAttributes attributes)
Description copied from interface:IWithExtAttributes
Sets theExtAttributes
object associated with this object.- Specified by:
setExtAttributes
in interfaceIWithExtAttributes
- Parameters:
attributes
- theExtAttributes
object associated with this object. If null, a newExtAttributes
object is created.
-
getExtAttributes
public ExtAttributes getExtAttributes()
Description copied from interface:IWithExtAttributes
Gets theExtAttributes
object for the parent object. If none exists, one is created.- Specified by:
getExtAttributes
in interfaceIWithExtAttributes
- Returns:
- the
ExtAttributes
object for the parent object, never null.
-
hasExtAttribute
public boolean hasExtAttribute()
Description copied from interface:IWithExtAttributes
Indicates if at least one extension attribute is present.- Specified by:
hasExtAttribute
in interfaceIWithExtAttributes
- Returns:
- true if at least one extension attribute is present; false otherwise.
-
getExtAttributeValue
public String getExtAttributeValue(String namespaceURI, String localName)
Description copied from interface:IWithExtAttributes
Gets the value for a given extension attribute.- Specified by:
getExtAttributeValue
in interfaceIWithExtAttributes
- Parameters:
namespaceURI
- the URI of the namespace for the attribute.localName
- the name of the attribute.- Returns:
- the value of the extension attribute, or null if it does not exist.
-
iterator
public Iterator<Translation> iterator()
- Specified by:
iterator
in interfaceIterable<Translation>
-
getTranslations
public List<Translation> getTranslations()
Gets the list of theTranslation
objects for this entry.- Returns:
- the list of the
Translation
objects for this entry (never null).
-
-