Class DocumentType<T>
- java.lang.Object
-
- com.biomatters.geneious.publicapi.plugin.DocumentType<T>
-
public final class DocumentType<T> extends java.lang.Object
Declares one Geneious plugin document type used for associating icons and human readable names withPluginDocument
classes. You can use either one of the static instances: Or DocumentTypes may be generated a plugin viaGeneiousPlugin.getDocumentTypes()
-
-
Field Summary
Fields Modifier and Type Field Description static DocumentType<AliasDocument>
ALIAS_DOCUMENT_TYPE
Document type forAliasDocument
static DocumentType<SequenceAlignmentDocument>
ALIGNMENT_TYPE
SequenceAlignmentDocument document typestatic DocumentType<AminoAcidSequenceDocument>
AMINO_ACID_SEQUENCE_TYPE
AminoAcidSequenceDocument document typestatic DocumentType<JournalArticleDocument>
ARTICLE_TYPE
JournalArticleDocument document typejava.lang.Class<T>
classOfDocument
Java class of document.static DocumentType<CodonUsageTableDocument>
CODON_USAGE_TABLE_DOCUMENT_TYPE
Document type forCodonUsageTableDocument
static DocumentType<SequenceAlignmentDocument>
CONTIG_TYPE
Contig document typestatic DocumentField
DOCUMENT_TYPE_FIELD
A field used for searching databases based on the document type.Icons
documentIcon
An icon associated with documents of that type.java.lang.String
humanReadableName
Human readable name of document type.static DocumentType<MolecularStructureDocument>
MOLECULAR_STRUCTURE_TYPE
MolecularStructureDocument document typestatic DocumentType<?>
NUCLEOTIDE_SEQUENCE_LIST_TYPE
Nucleotide Sequence List document typestatic DocumentType<NucleotideSequenceDocument>
NUCLEOTIDE_SEQUENCE_TYPE
NucleotideSequenceDocument document typestatic DocumentType<OligoSequenceDocument>
OLIGO_DOC_TYPE
Primer/Oligo sequence document typestatic java.lang.String
OVERRIDE_DOCUMENT_TYPE_KEY
APluginDocument
may return a value fromPluginDocument.getFieldValue(String)
with thisfieldCodeName
to change the class used to get the document type of the document.java.lang.Class
overrideClass
an alternative class that can be set on a document usingOVERRIDE_DOCUMENT_TYPE_KEY
to change its icon etc.static DocumentType<?>
PROTEIN_SEQUENCE_LIST_TYPE
Protein Sequence List document typestatic DocumentType<PublicationDocument>
PUBLICATION_TYPE
PublicationDocument document typestatic DocumentType<SequenceListDocument>
SEQUENCE_LIST_TYPE
Sequence list document type which matches either nucleotide or protein sequence lists.static DocumentType<CombinedAlignmentAndAminoAcidSequenceDocument>
SEQUENCE_SEARCH_AMINO_ACID_HIT
CombinedAlignmentAndAminoAcidSequenceDocument document typestatic DocumentType<CombinedAlignmentAndNucleotideSequenceDocument>
SEQUENCE_SEARCH_NUCLEOTIDE_HIT
CombinedAlignmentAndNucleotideSequenceDocument document typestatic DocumentType<SequenceDocument>
SEQUENCE_TYPE
SequenceDocument document typestatic DocumentType<TaxonomyDocument>
TAXONOMY_TYPE
TaxonomyDocument document typestatic DocumentType<TextDocument>
TEXT_DOCUMENT_TYPE
Document type forTextDocument
static DocumentType<TreeDocument>
TREE_TYPE
TreeDocument document type
-
Constructor Summary
Constructors Constructor Description DocumentType(java.lang.String name, java.lang.Class<T> classOfDocument, Icons icon)
constructor.DocumentType(java.lang.String name, java.lang.Class<T> classOfDocument, java.lang.Class overrideClass, Icons icon)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
int
hashCode()
static boolean
isAlignment(AnnotatedPluginDocument annotatedPluginDocument)
static boolean
isAlignment(PluginDocument document)
static boolean
isAlignmentAndNotSequence(AnnotatedPluginDocument document)
static boolean
isAlignmentAndNotSequence(PluginDocument document)
static boolean
isAminoAcidSequence(AnnotatedPluginDocument annotatedPluginDocument)
static boolean
isAminoAcidSequence(PluginDocument document)
static boolean
isNucleotideSequence(AnnotatedPluginDocument annotatedPluginDocument)
static boolean
isNucleotideSequence(PluginDocument document)
static boolean
isSequence(AnnotatedPluginDocument annotatedPluginDocument)
static boolean
isSequence(PluginDocument document)
static boolean
isSequenceList(AnnotatedPluginDocument annotatedPluginDocument)
static boolean
isSequenceList(PluginDocument document)
boolean
matches(AnnotatedPluginDocument document)
Checks if the given document matches this DocumentTypestatic boolean
matches(java.util.Set<DocumentType> documentTypes, AnnotatedPluginDocument document)
Returns true if the given document is at least one of the given document types.java.lang.String
toString()
-
-
-
Field Detail
-
OLIGO_DOC_TYPE
public static DocumentType<OligoSequenceDocument> OLIGO_DOC_TYPE
Primer/Oligo sequence document type
-
MOLECULAR_STRUCTURE_TYPE
public static final DocumentType<MolecularStructureDocument> MOLECULAR_STRUCTURE_TYPE
MolecularStructureDocument document type- Since:
- API 4.50 (Geneious 5.5.0)
-
SEQUENCE_TYPE
public static final DocumentType<SequenceDocument> SEQUENCE_TYPE
SequenceDocument document type- Since:
- API 4.50 (Geneious 5.5.0)
-
NUCLEOTIDE_SEQUENCE_TYPE
public static final DocumentType<NucleotideSequenceDocument> NUCLEOTIDE_SEQUENCE_TYPE
NucleotideSequenceDocument document type- Since:
- API 4.50 (Geneious 5.5.0)
-
AMINO_ACID_SEQUENCE_TYPE
public static final DocumentType<AminoAcidSequenceDocument> AMINO_ACID_SEQUENCE_TYPE
AminoAcidSequenceDocument document type- Since:
- API 4.50 (Geneious 5.5.0)
-
ALIGNMENT_TYPE
public static final DocumentType<SequenceAlignmentDocument> ALIGNMENT_TYPE
SequenceAlignmentDocument document type- Since:
- API 4.50 (Geneious 5.5.0)
-
TAXONOMY_TYPE
public static final DocumentType<TaxonomyDocument> TAXONOMY_TYPE
TaxonomyDocument document type- Since:
- API 4.50 (Geneious 5.5.0)
-
ARTICLE_TYPE
public static final DocumentType<JournalArticleDocument> ARTICLE_TYPE
JournalArticleDocument document type- Since:
- API 4.50 (Geneious 5.5.0)
-
PUBLICATION_TYPE
public static final DocumentType<PublicationDocument> PUBLICATION_TYPE
PublicationDocument document type- Since:
- API 4.50 (Geneious 5.5.0)
-
TREE_TYPE
public static final DocumentType<TreeDocument> TREE_TYPE
TreeDocument document type- Since:
- API 4.50 (Geneious 5.5.0)
-
SEQUENCE_LIST_TYPE
public static final DocumentType<SequenceListDocument> SEQUENCE_LIST_TYPE
Sequence list document type which matches either nucleotide or protein sequence lists. However, for icon purposes,PROTEIN_SEQUENCE_LIST_TYPE
andNUCLEOTIDE_SEQUENCE_LIST_TYPE
takes precedence over this.- Since:
- API 4.700 (Geneious 7.0.0)
- See Also:
PROTEIN_SEQUENCE_LIST_TYPE
-
PROTEIN_SEQUENCE_LIST_TYPE
public static final DocumentType<?> PROTEIN_SEQUENCE_LIST_TYPE
Protein Sequence List document type- Since:
- API 4.700 (Geneious 7.0.0)
- See Also:
SEQUENCE_LIST_TYPE
-
NUCLEOTIDE_SEQUENCE_LIST_TYPE
public static final DocumentType<?> NUCLEOTIDE_SEQUENCE_LIST_TYPE
Nucleotide Sequence List document type- Since:
- API 4.810 (Geneious 8.1.0)
- See Also:
SEQUENCE_LIST_TYPE
-
CONTIG_TYPE
public static final DocumentType<SequenceAlignmentDocument> CONTIG_TYPE
Contig document type- Since:
- API 4.700 (Geneious 7.0.0)
-
ALIAS_DOCUMENT_TYPE
public static final DocumentType<AliasDocument> ALIAS_DOCUMENT_TYPE
Document type forAliasDocument
- Since:
- API 4.1000 (Geneious 10.0.0)
-
TEXT_DOCUMENT_TYPE
public static final DocumentType<TextDocument> TEXT_DOCUMENT_TYPE
Document type forTextDocument
- Since:
- API 4.201900 (Geneious 2019.0.0)
-
CODON_USAGE_TABLE_DOCUMENT_TYPE
public static final DocumentType<CodonUsageTableDocument> CODON_USAGE_TABLE_DOCUMENT_TYPE
Document type forCodonUsageTableDocument
- Since:
- API 4.201900 (Geneious 2019.0.0)
-
SEQUENCE_SEARCH_NUCLEOTIDE_HIT
public static final DocumentType<CombinedAlignmentAndNucleotideSequenceDocument> SEQUENCE_SEARCH_NUCLEOTIDE_HIT
CombinedAlignmentAndNucleotideSequenceDocument document type- Since:
- API 4.50 (Geneious 5.5.0)
-
SEQUENCE_SEARCH_AMINO_ACID_HIT
public static final DocumentType<CombinedAlignmentAndAminoAcidSequenceDocument> SEQUENCE_SEARCH_AMINO_ACID_HIT
CombinedAlignmentAndAminoAcidSequenceDocument document type- Since:
- API 4.50 (Geneious 5.5.0)
-
OVERRIDE_DOCUMENT_TYPE_KEY
public static final java.lang.String OVERRIDE_DOCUMENT_TYPE_KEY
APluginDocument
may return a value fromPluginDocument.getFieldValue(String)
with thisfieldCodeName
to change the class used to get the document type of the document. The value must be the fully qualified class name. Eg. this can be used to change the icon of a document depending on its contents as opposed to just its class.- See Also:
- Constant Field Values
-
humanReadableName
public final java.lang.String humanReadableName
Human readable name of document type.
-
classOfDocument
public final java.lang.Class<T> classOfDocument
Java class of document.
-
overrideClass
public final java.lang.Class overrideClass
an alternative class that can be set on a document usingOVERRIDE_DOCUMENT_TYPE_KEY
to change its icon etc. Doesn't need to be a subclass of PluginDocument. Never null but may be the same asclassOfDocument
.- Since:
- API 4.700 (Geneious 7.0.0)
-
documentIcon
public final Icons documentIcon
An icon associated with documents of that type.
-
DOCUMENT_TYPE_FIELD
public static final DocumentField DOCUMENT_TYPE_FIELD
A field used for searching databases based on the document type.
-
-
Constructor Detail
-
DocumentType
public DocumentType(java.lang.String name, java.lang.Class<T> classOfDocument, Icons icon)
constructor.- Parameters:
name
- human readable name of document typeclassOfDocument
- Java class of document, should extend PluginDocumenticon
- icon for documents of that type. May be null.
-
DocumentType
public DocumentType(java.lang.String name, java.lang.Class<T> classOfDocument, java.lang.Class overrideClass, Icons icon)
- Parameters:
name
- human readable name of document typeclassOfDocument
- Java class of document, should extend PluginDocumentoverrideClass
- an optional alternative class that can be set on a document usingOVERRIDE_DOCUMENT_TYPE_KEY
to change its icon etc (may be null). Doesn't need to be a subclass of PluginDocumenticon
- icon for documents of that type. May be null.- Since:
- API 4.700 (Geneious 7.0.0)
-
-
Method Detail
-
isSequenceList
public static boolean isSequenceList(PluginDocument document)
- Parameters:
document
- the document (may be null in which case this will return false)- Returns:
- true iff this document is a SequenceListDocument
-
isSequenceList
public static boolean isSequenceList(AnnotatedPluginDocument annotatedPluginDocument)
- Parameters:
annotatedPluginDocument
- the document (may be null in which case this will return false)- Returns:
- true iff this document is a SequenceListDocument
-
isSequence
public static boolean isSequence(PluginDocument document)
- Parameters:
document
- the document (may be null in which case this will return false)- Returns:
- true iff this document is a SequenceDocument
-
isNucleotideSequence
public static boolean isNucleotideSequence(PluginDocument document)
- Parameters:
document
- the document (may be null in which case this will return false)- Returns:
- true iff this document is a NucleotideSequenceDocument
- Since:
- API 4.40 (Geneious 5.4.0)
-
isAminoAcidSequence
public static boolean isAminoAcidSequence(PluginDocument document)
- Parameters:
document
- the document (may be null in which case this will return false)- Returns:
- true iff this document is a AminoAcidSequenceDocument
- Since:
- API 4.40 (Geneious 5.4.0)
-
isSequence
public static boolean isSequence(AnnotatedPluginDocument annotatedPluginDocument)
- Parameters:
annotatedPluginDocument
- the document (may be null in which case this will return false)- Returns:
- true iff this document is a SequenceDocument
-
isNucleotideSequence
public static boolean isNucleotideSequence(AnnotatedPluginDocument annotatedPluginDocument)
- Parameters:
annotatedPluginDocument
- the document (may be null in which case this will return false)- Returns:
- true iff this document is a NucleotideSequenceDocument
- Since:
- API 4.40 (Geneious 5.4.0)
-
isAminoAcidSequence
public static boolean isAminoAcidSequence(AnnotatedPluginDocument annotatedPluginDocument)
- Parameters:
annotatedPluginDocument
- the document (may be null in which case this will return false)- Returns:
- true iff this document is a AminoAcidSequenceDocument
- Since:
- API 4.40 (Geneious 5.4.0)
-
isAlignment
public static boolean isAlignment(PluginDocument document)
- Parameters:
document
- the document (may be null in which case this will return false)- Returns:
- true iff this document is a SequenceAlignmentDocument
-
isAlignment
public static boolean isAlignment(AnnotatedPluginDocument annotatedPluginDocument)
- Parameters:
annotatedPluginDocument
- the document (may be null in which case this will return false)- Returns:
- true iff this document is a SequenceAlignmentDocument
-
isAlignmentAndNotSequence
public static boolean isAlignmentAndNotSequence(PluginDocument document)
- Parameters:
document
- the document (may be null in which case this will return false)- Returns:
- true iff this document is a SequenceAlignmentDocument and not a SequenceDocument
(so it will return false on a
CombinedAlignmentAndSequenceDocument
-
isAlignmentAndNotSequence
public static boolean isAlignmentAndNotSequence(AnnotatedPluginDocument document)
- Parameters:
document
- the document (may be null in which case this will return false)- Returns:
- true iff this document is a SequenceAlignmentDocument and not a SequenceDocument
(so it will return false on a
CombinedAlignmentAndSequenceDocument
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
matches
public boolean matches(AnnotatedPluginDocument document)
Checks if the given document matches this DocumentType- Parameters:
document
- the document to check if its type is this DocumentType- Returns:
- true if this document matches this document type
- Since:
- API 4.810 (Geneious 8.1.0)
-
matches
public static boolean matches(java.util.Set<DocumentType> documentTypes, AnnotatedPluginDocument document)
Returns true if the given document is at least one of the given document types.- Parameters:
documentTypes
- the document types to check if this document is at least one ofdocument
- the document to check- Returns:
- true if the given document is at least one of the given document types.
- Since:
- API 4.810 (Geneious 8.1.0)
-
-