From: <rv...@us...> - 2010-03-15 01:00:51
|
Revision: 568 http://treebase.svn.sourceforge.net/treebase/?rev=568&view=rev Author: rvos Date: 2010-03-15 01:00:44 +0000 (Mon, 15 Mar 2010) Log Message: ----------- Added getAnnotations() and getLabel() for nexml and rdf serialization. Modified Paths: -------------- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/CharacterMatrix.java Modified: trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/CharacterMatrix.java =================================================================== --- trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/CharacterMatrix.java 2010-03-12 23:44:43 UTC (rev 567) +++ trunk/treebase-core/src/main/java/org/cipres/treebase/domain/matrix/CharacterMatrix.java 2010-03-15 01:00:44 UTC (rev 568) @@ -31,7 +31,9 @@ import org.hibernate.annotations.LazyCollection; import org.hibernate.annotations.LazyCollectionOption; +import org.cipres.treebase.Constants; import org.cipres.treebase.TreebaseUtil; +import org.cipres.treebase.domain.Annotation; import org.cipres.treebase.domain.taxon.TaxonLabel; /** @@ -931,4 +933,20 @@ @Override @Transient public boolean isCharacterMatrix() { return true; } + + @Transient + public List<Annotation> getAnnotations() { + List<Annotation> annotations = super.getAnnotations(); + annotations.add(new Annotation(Constants.TBTermsURI,"tb:type.matrix",getDataType().getDescription())); + annotations.add(new Annotation(Constants.TBTermsURI,"tb:ntax.matrix",getnTax())); + annotations.add(new Annotation(Constants.TBTermsURI,"tb:nchar.matrix",getnChar())); + annotations.add(new Annotation(Constants.TBTermsURI,"tb:identifier.matrix",getId())); + return annotations; + } + + @Transient + public String getLabel() { + return getTitle(); + } + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |