public class PDEEventReader extends AbstractXMLEventReader<PDEReaderStreamDataProvider> implements PDEConstants
This reader supports reading sequence data and metadata as well as character sets from PDE files.
Reading of taxon sets is not supported. Identifiers used to specify the number of missing characters
at the start or end of a sequence are translated to the according number of missing symbols in
SequenceTokensEvent
s. Token set events are fired with the CharacterStateSetType
DNA or
amino acid, according to the information in the file.
Sequence metadata of the types STRING
and NUMBER
is represented as LiteralMetadataEvent
s,
data of the type FILE
as ResourceMetadataEvent
s. The predicate is either
ReadWriteConstants.PREDICATE_HAS_LITERAL_METADATA
or ReadWriteConstants.PREDICATE_HAS_RESOURCE_METADATA
.
Char set attributes are represented by metaevents with predefined predicates according to the attribute.
INTERNAL_USE_NAMESPACE, TAG_PARENT_OF_ROOT
AMINO_TYPE, ATTR_ALIGNMENT_LENGTH, ATTR_CHARSET_LABEL, ATTR_COLOR, ATTR_DATATYPE, ATTR_ID, ATTR_SEQUENCE_COUNT, ATTR_SEQUENCE_INDEX, ATTR_VERSION, ATTR_VISIBILITY, DNA_TYPE, FIRST_CUSTOM_META_ID, META_ID_ACCESS_NUMBER, META_ID_COMMENT, META_ID_LINKED_FILE, META_ID_SEQUENCE_LABEL, META_TYPE_FILE, META_TYPE_NUMBER, META_TYPE_STRING, PDE_FORMAT_NAME, PDE_NAMESPACE_PREFIX, PDE_PREDICATE_NAMESPACE, PREDICATE_ACCESS_NUMBER, PREDICATE_CHARSET_COLOR, PREDICATE_CHARSET_VISIBILITY, PREDICATE_COMMENT, PREDICATE_DESCRIPTION, PREDICATE_LINKED_FILE, SEQUENCE_END, TAG_ALIGNMENT, TAG_BLOCK, TAG_CHARSET, TAG_CHARSETS, TAG_DESCRIPTION, TAG_HEADER, TAG_MATRIX, TAG_META_TYPE_DEFINITIONS, TAG_ROOT, TAG_SEQUENCE_INFORMATION, TAG_SEQUENCE_META_INFORMATION, UNKNOWN_CHARS
ATTRIBUTE_STRING_KEY, ATTRIBUTES_NAMESPACE_FOLDER, DATA_TYPE_NAMESPACE_FOLDER, DATA_TYPE_SIMPLE_VALUE_LIST, DEFAULT_CHAR_SET_ID_PREFIX, DEFAULT_CHARACTER_DEFINITION_ID_PREFIX, DEFAULT_EDGE_ID_PREFIX, DEFAULT_GENERAL_ID_PREFIX, DEFAULT_MATRIX_ID_PREFIX, DEFAULT_MAX_COMMENT_LENGTH, DEFAULT_MAX_TOKENS_TO_READ, DEFAULT_META_ID_PREFIX, DEFAULT_NETWORK_ID_PREFIX, DEFAULT_NODE_EDGE_SET_ID_PREFIX, DEFAULT_NODE_ID_PREFIX, DEFAULT_OTU_ID_PREFIX, DEFAULT_OTU_LIST_ID_PREFIX, DEFAULT_OTU_SET_ID_PREFIX, DEFAULT_SEQUENCE_ID_PREFIX, DEFAULT_SEQUENCE_SET_ID_PREFIX, DEFAULT_TOKEN_DEFINITION_ID_PREFIX, DEFAULT_TOKEN_SET_ID_PREFIX, DEFAULT_TREE_ID_PREFIX, DEFAULT_TREE_NETWORK_GROUP_ID_PREFIX, DEFAULT_TREE_NETWORK_SET_ID_PREFIX, JPHYLOIO_ATTRIBUTES_NAMESPACE, JPHYLOIO_ATTRIBUTES_PREFIX, JPHYLOIO_DATA_TYPE_NAMESPACE, JPHYLOIO_DATA_TYPE_PREFIX, JPHYLOIO_FORMATS_NAMESPACE_PREFIX, JPHYLOIO_GENERAL_NAMESPACE, JPHYLOIO_NAMESPACE_PREFIX, JPHYLOIO_PREDICATE_NAMESPACE, JPHYLOIO_PREDICATE_PREFIX, PREDICATE_CHARACTER_COUNT, PREDICATE_EDGE_LENGTH, PREDICATE_EDGE_SOURCE_NODE, PREDICATE_EDGE_TARGET_NODE, PREDICATE_HAS_CUSTOM_XML, PREDICATE_HAS_LITERAL_METADATA, PREDICATE_HAS_RESOURCE_METADATA, PREDICATE_IS_CROSSLINK, PREDICATE_NAMESPACE_FOLDER, PREDICATE_PART_SEPERATOR, PREDICATE_SEQUENCE_COUNT, RESERVED_ID_PREFIX
Constructor and Description |
---|
PDEEventReader(java.io.File file,
ReadWriteParameterMap parameters) |
PDEEventReader(java.io.InputStream stream,
ReadWriteParameterMap parameters) |
PDEEventReader(java.io.Reader reader,
ReadWriteParameterMap parameters) |
PDEEventReader(javax.xml.stream.XMLEventReader xmlReader,
ReadWriteParameterMap parameters) |
Modifier and Type | Method and Description |
---|---|
protected PDEReaderStreamDataProvider |
createStreamDataProvider()
This method is called in the constructor of
AbstractEventReader to initialize the stream
data provider that will be returned by AbstractEventReader.getStreamDataProvider() . |
protected void |
fillMap() |
java.lang.String |
getFormatID()
Returns a string ID uniquely identifying the target format of this instance.
|
close, createMetaXMLEventReader, createMetaXMLStreamReader, getElementReader, getElementReaderMap, getEncounteredTags, getNamespaceContext, getXMLReader, isAllowDefaultNamespace, parseQName, putElementReader, readNextEvent
addEventListener, fireEvent, getCurrentEventCollection, getIDManager, getLastNonCommentEvent, getParameters, getParentInformation, getPreviousEvent, getSequenceTokensEventManager, getStreamDataProvider, getUpcomingEvents, hasNextEvent, hasSpecialEventCollection, isBeforeFirstAccess, next, nextOfType, peek, removeEventListener, resetCurrentEventCollection, setCurrentEventCollection
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addEventListener, getLastNonCommentEvent, getParentInformation, getPreviousEvent, hasNextEvent, next, nextOfType, peek, removeEventListener
public PDEEventReader(java.io.File file, ReadWriteParameterMap parameters) throws java.io.IOException, javax.xml.stream.XMLStreamException
java.io.IOException
javax.xml.stream.XMLStreamException
public PDEEventReader(java.io.InputStream stream, ReadWriteParameterMap parameters) throws java.io.IOException, javax.xml.stream.XMLStreamException
java.io.IOException
javax.xml.stream.XMLStreamException
public PDEEventReader(java.io.Reader reader, ReadWriteParameterMap parameters) throws java.io.IOException, javax.xml.stream.XMLStreamException
java.io.IOException
javax.xml.stream.XMLStreamException
public PDEEventReader(javax.xml.stream.XMLEventReader xmlReader, ReadWriteParameterMap parameters)
public java.lang.String getFormatID()
JPhyloIOFormatSpecificObject
JPhyloIOReaderWriterFactory.getFormatInfo(String)
.
Third party developers that create readers or writers for additional formats must make sure to use a globally unique
format ID. It is strongly recommended to use owned reverse domain names for this (e.g.
org.example.additionalformat
).
getFormatID
in interface JPhyloIOFormatSpecificObject
JPhyloIOReaderWriterFactory.getFormatInfo(String)
protected void fillMap()
fillMap
in class AbstractXMLEventReader<PDEReaderStreamDataProvider>
protected PDEReaderStreamDataProvider createStreamDataProvider()
AbstractEventReader
AbstractEventReader
to initialize the stream
data provider that will be returned by AbstractEventReader.getStreamDataProvider()
. Inherit classes that use
their own stream data provider implementation should overwrite this method.
This default implementation creates a new instance of ReaderStreamDataProvider
.
createStreamDataProvider
in class AbstractXMLEventReader<PDEReaderStreamDataProvider>