eu.etaxonomy.cdm.model.common
Class DefinedTermBase<T extends DefinedTermBase>

java.lang.Object
  extended by eu.etaxonomy.cdm.model.common.CdmBase
      extended by eu.etaxonomy.cdm.model.common.VersionableEntity
          extended by eu.etaxonomy.cdm.model.common.AnnotatableEntity
              extended by eu.etaxonomy.cdm.model.common.IdentifiableEntity<IIdentifiableEntityCacheStrategy>
                  extended by eu.etaxonomy.cdm.model.common.TermBase
                      extended by eu.etaxonomy.cdm.model.common.DefinedTermBase<T>
All Implemented Interfaces:
IAnnotatableEntity, ICdmBase, IDefinedTerm<T>, IIdentifiableEntity, ILoadableTerm<T>, ISourceable<IdentifiableSource>, IVersionableEntity, Serializable, Cloneable
Direct Known Subclasses:
AnnotationType, DerivationEventType, ExtensionType, Feature, InstitutionType, Language, MarkerType, MeasurementUnit, NamedAreaType, NaturalLanguageTerm, OrderedTermBase, PreservationMethod, ReferenceSystem, RightsTerm, StatisticalMeasure, TextFormat

@Entity
@ClassBridge(impl=DefinedTermBaseClassBridge.class)
public abstract class DefinedTermBase<T extends DefinedTermBase>
extends TermBase
implements ILoadableTerm<T>, IDefinedTerm<T>

workaround for enumerations, base type according to TDWG. For linear ordering use partOf relation and BreadthFirst. Default iterator order should therefore be BreadthFirst (not DepthFirst)

Version:
1.0
Author:
m.doering
See Also:
Serialized Form

Field Summary
protected  T partOf
           
protected  TermVocabulary<T> vocabulary
           
 
Fields inherited from class eu.etaxonomy.cdm.model.common.IdentifiableEntity
cacheStrategy, NOT_PROTECTED, PROTECTED, protectedTitleCache, titleCache
 
Fields inherited from class eu.etaxonomy.cdm.model.common.AnnotatableEntity
annotations, markers
 
Fields inherited from class eu.etaxonomy.cdm.model.common.CdmBase
uuid
 
Constructor Summary
DefinedTermBase()
           
DefinedTermBase(String term, String label, String labelAbbrev)
           
 
Method Summary
 void addGeneralizationOf(T generalization)
           
 void addIncludes(T includes)
           
 void addMedia(Media media)
           
 Object clone()
          Clones this DefinedTermBase.
 T getByUuid(UUID uuid)
           
 Set<T> getGeneralizationOf()
          Returns all defined terms this term is a generalization for.
 Set<T> getIncludes()
          Returns all defined terms this term includes.
 T getKindOf()
          Returns the defined term this term is a kind of.
 Set<Media> getMedia()
           
 T getPartOf()
          Returns the defined term this term is a part of.
 TermVocabulary<T> getVocabulary()
           
 T readCsvLine(Class<T> termClass, List<String> csvLine, Map<UUID,DefinedTermBase> terms)
          Fills the term with contents from a csvLine.
protected static
<TERM extends DefinedTermBase>
TERM
readCsvLine(TERM newInstance, List<String> csvLine, Language lang)
           
 void removeGeneralization(T generalization)
           
 void removeIncludes(T includes)
           
 void removeMedia(Media media)
           
abstract  void resetTerms()
           
protected abstract  void setDefaultTerms(TermVocabulary<T> termVocabulary)
           
protected  void setGeneralizationOf(Set<T> value)
           
protected  void setIncludes(Set<T> includes)
           
 void setKindOf(T kindOf)
           
 void setPartOf(T partOf)
           
protected  void setVocabulary(TermVocabulary<T> newVocabulary)
           
 void writeCsvLine(au.com.bytecode.opencsv.CSVWriter writer, T term)
           
 
Methods inherited from class eu.etaxonomy.cdm.model.common.TermBase
addRepresentation, equals, getDescription, getDescription, getLabel, getLabel, getPreferredRepresentation, getPreferredRepresentation, getRepresentation, getRepresentations, getUri, removeRepresentation, setLabel, setLabel, setUri, toString
 
Methods inherited from class eu.etaxonomy.cdm.model.common.IdentifiableEntity
addCredit, addCredit, addExtension, addExtension, addRights, addSource, addSource, compareTo, generateTitle, getCacheStrategy, getCredits, getCredits, getData, getExtensions, getExtensions, getExtensions, getLsid, getRights, getSources, getTitleCache, getTruncatedCache, initListener, isProtectedTitleCache, regenerateTitleCache, removeCredit, removeCredit, removeExtension, removeRights, removeSource, setCacheStrategy, setLsid, setProtectedTitleCache, setTitleCache, setTitleCache
 
Methods inherited from class eu.etaxonomy.cdm.model.common.AnnotatableEntity
addAnnotation, addMarker, getAnnotations, getMarkers, hasMarker, hasMarker, removeAnnotation, removeMarker
 
Methods inherited from class eu.etaxonomy.cdm.model.common.VersionableEntity
getUpdated, getUpdatedBy, setUpdated, setUpdatedBy
 
Methods inherited from class eu.etaxonomy.cdm.model.common.CdmBase
addPropertyChangeListener, addPropertyChangeListener, clone, deproxy, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getCreated, getCreatedBy, getId, getUuid, hashCode, hasListeners, instanceToString, invokeSetMethod, invokeSetMethodWithNull, isInstanceOf, removePropertyChangeListener, removePropertyChangeListener, setCreated, setCreatedBy, setId, setUuid
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface eu.etaxonomy.cdm.model.common.IDefinedTerm
getUuid
 
Methods inherited from interface eu.etaxonomy.cdm.model.common.IAnnotatableEntity
addAnnotation, addMarker, getAnnotations, getMarkers, hasMarker, hasMarker, removeAnnotation, removeMarker
 
Methods inherited from interface eu.etaxonomy.cdm.model.common.IVersionableEntity
getUpdated, getUpdatedBy, setUpdated, setUpdatedBy
 
Methods inherited from interface eu.etaxonomy.cdm.model.common.ICdmBase
getCreated, getCreatedBy, getId, getUuid, setCreated, setCreatedBy, setId, setUuid
 

Field Detail

partOf

protected T extends DefinedTermBase partOf

vocabulary

protected TermVocabulary<T extends DefinedTermBase> vocabulary
Constructor Detail

DefinedTermBase

public DefinedTermBase()

DefinedTermBase

public DefinedTermBase(String term,
                       String label,
                       String labelAbbrev)
Method Detail

resetTerms

public abstract void resetTerms()

setDefaultTerms

protected abstract void setDefaultTerms(TermVocabulary<T> termVocabulary)

readCsvLine

public T readCsvLine(Class<T> termClass,
                     List<String> csvLine,
                     Map<UUID,DefinedTermBase> terms)
Description copied from interface: ILoadableTerm
Fills the term with contents from a csvLine. If the csvLine represents the default language the csvLine attributes are merged into the existing default language and the default Language is returned.

Specified by:
readCsvLine in interface ILoadableTerm<T extends DefinedTermBase>
Returns:

readCsvLine

protected static <TERM extends DefinedTermBase> TERM readCsvLine(TERM newInstance,
                                                                 List<String> csvLine,
                                                                 Language lang)

writeCsvLine

public void writeCsvLine(au.com.bytecode.opencsv.CSVWriter writer,
                         T term)
Specified by:
writeCsvLine in interface ILoadableTerm<T extends DefinedTermBase>

getByUuid

public T getByUuid(UUID uuid)
Specified by:
getByUuid in interface IDefinedTerm<T extends DefinedTermBase>

getKindOf

public T getKindOf()
Description copied from interface: IDefinedTerm
Returns the defined term this term is a kind of. Therefore the returned term is a generalization of this term

Specified by:
getKindOf in interface IDefinedTerm<T extends DefinedTermBase>

setKindOf

public void setKindOf(T kindOf)

getGeneralizationOf

public Set<T> getGeneralizationOf()
Description copied from interface: IDefinedTerm
Returns all defined terms this term is a generalization for. Therefore the returned terms are kind of this term

Specified by:
getGeneralizationOf in interface IDefinedTerm<T extends DefinedTermBase>

setGeneralizationOf

protected void setGeneralizationOf(Set<T> value)

addGeneralizationOf

public void addGeneralizationOf(T generalization)

removeGeneralization

public void removeGeneralization(T generalization)

getPartOf

public T getPartOf()
Description copied from interface: IDefinedTerm
Returns the defined term this term is a part of. Therefore the returned term includes this term

Specified by:
getPartOf in interface IDefinedTerm<T extends DefinedTermBase>

setPartOf

public void setPartOf(T partOf)

getIncludes

public Set<T> getIncludes()
Description copied from interface: IDefinedTerm
Returns all defined terms this term includes. Therefore the returned terms are part of this term

Specified by:
getIncludes in interface IDefinedTerm<T extends DefinedTermBase>

setIncludes

protected void setIncludes(Set<T> includes)

addIncludes

public void addIncludes(T includes)

removeIncludes

public void removeIncludes(T includes)

getMedia

public Set<Media> getMedia()
Specified by:
getMedia in interface IDefinedTerm<T extends DefinedTermBase>

addMedia

public void addMedia(Media media)

removeMedia

public void removeMedia(Media media)

getVocabulary

public TermVocabulary<T> getVocabulary()
Returns:

setVocabulary

protected void setVocabulary(TermVocabulary<T> newVocabulary)
Parameters:
newVocabulary -

clone

public Object clone()
Clones this DefinedTermBase. This is a shortcut that enables to create a new instance that differs only slightly from this defined term base by modifying only some of the attributes.

Overrides:
clone in class TermBase
See Also:
TermBase.clone(), Object.clone()


Copyright © 2007-2013 EDIT. All Rights Reserved.