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 newGlossEntryobject.GlossEntry(GlossEntry original)Copy constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TranslationaddTranslation(String text)Adds a translation to this entry.DefinitiongetDefinition()Gets the definition for this entry.ExtAttributesgetExtAttributes()Gets theExtAttributesobject for the parent object.StringgetExtAttributeValue(String namespaceURI, String localName)Gets the value for a given extension attribute.ExtElementsgetExtElements()Gets theExtElementsobject associated with this object.StringgetId()Gets the id for this entry.StringgetRef()Gets the reference for this entry.TermgetTerm()Gets the term for this entry.List<Translation>getTranslations()Gets the list of theTranslationobjects for this entry.booleanhasExtAttribute()Indicates if at least one extension attribute is present.booleanhasExtElements()Indicates if there is aExtElementsobject associated with this object.Iterator<Translation>iterator()DefinitionsetDefinition(Definition definition)Sets a new definition for this entry.voidsetExtAttributes(ExtAttributes attributes)Sets theExtAttributesobject associated with this object.ExtElementssetExtElements(ExtElements elements)Sets theExtElementsobject associated with this object.voidsetId(String id)Sets the id for this entry.voidsetRef(String ref)Sets the reference for this entry.TermsetTerm(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 newGlossEntryobject.
-
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
Termobject.
-
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
Definitionobject.
-
addTranslation
public Translation addTranslation(String text)
Adds a translation to this entry.- Parameters:
text- the text of the translation to add.- Returns:
- the new
Translationobject.
-
getExtElements
public ExtElements getExtElements()
Description copied from interface:IWithExtElementsGets theExtElementsobject associated with this object. If none exists one is created.- Specified by:
getExtElementsin interfaceIWithExtElements- Returns:
- the
ExtElementsobject associated with this object. If none exists one is created.
-
hasExtElements
public boolean hasExtElements()
Description copied from interface:IWithExtElementsIndicates if there is aExtElementsobject associated with this object.- Specified by:
hasExtElementsin interfaceIWithExtElements- Returns:
- true if there is a
ExtElementsobject associated with this object, false otherwise.
-
setExtElements
public ExtElements setExtElements(ExtElements elements)
Description copied from interface:IWithExtElementsSets theExtElementsobject associated with this object.- Specified by:
setExtElementsin interfaceIWithExtElements- Parameters:
elements- theExtElementsobject associated with this object. If null, a newExtElementsobject is created.- Returns:
- the
ExtElementsobject associated with this object, never null.
-
setExtAttributes
public void setExtAttributes(ExtAttributes attributes)
Description copied from interface:IWithExtAttributesSets theExtAttributesobject associated with this object.- Specified by:
setExtAttributesin interfaceIWithExtAttributes- Parameters:
attributes- theExtAttributesobject associated with this object. If null, a newExtAttributesobject is created.
-
getExtAttributes
public ExtAttributes getExtAttributes()
Description copied from interface:IWithExtAttributesGets theExtAttributesobject for the parent object. If none exists, one is created.- Specified by:
getExtAttributesin interfaceIWithExtAttributes- Returns:
- the
ExtAttributesobject for the parent object, never null.
-
hasExtAttribute
public boolean hasExtAttribute()
Description copied from interface:IWithExtAttributesIndicates if at least one extension attribute is present.- Specified by:
hasExtAttributein 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:IWithExtAttributesGets the value for a given extension attribute.- Specified by:
getExtAttributeValuein 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:
iteratorin interfaceIterable<Translation>
-
getTranslations
public List<Translation> getTranslations()
Gets the list of theTranslationobjects for this entry.- Returns:
- the list of the
Translationobjects for this entry (never null).
-
-