public class JaxbToAlignment extends AbstractBaseAlignmentLoader<AlignmentType,CellType,ModifierType>
AlignmentType
loaded with JAXB to a
MutableAlignment
.Constructor and Description |
---|
JaxbToAlignment(AlignmentType alignment,
IOReporter reporter,
TypeIndex sourceTypes,
TypeIndex targetTypes,
PathUpdate updater) |
Modifier and Type | Method and Description |
---|---|
static void |
addBaseAlignment(MutableAlignment alignment,
URI newBase,
URI projectLocation,
TypeIndex sourceTypes,
TypeIndex targetTypes,
IOReporter reporter)
Adds the given base alignment to the given alignment.
|
MutableAlignment |
convert()
Create the converted alignment.
|
protected MutableCell |
createCell(CellType cell,
TypeIndex sourceTypes,
TypeIndex targetTypes,
IOReporter reporter)
Create a cell from the given cell representation
|
protected Map<String,URI> |
getBases(AlignmentType alignment)
Returns a map of prefix, URI pairs of base alignments for the given
alignment.
|
protected String |
getCellId(CellType cell)
Returns the cell id of the given cell.
|
protected Collection<CellType> |
getCells(AlignmentType alignment)
Returns a collection of cell representations of the given alignment
representation.
|
protected Collection<String> |
getDisabledForList(ModifierType modifier)
Returns the disabled for list of the given modifier representation.
|
protected String |
getModifiedCell(ModifierType modifier)
Returns the raw cell id that is modified by the given modifier.
|
protected Collection<ModifierType> |
getModifiers(AlignmentType alignment)
Returns a collection of modifier representations of the given alignment
representation.
|
protected TransformationMode |
getTransformationMode(ModifierType modifier)
Get the transformation mode specified in a modifier.
|
static AlignmentType |
load(InputStream in,
IOReporter reporter)
Load a
AlignmentType from an input stream. |
protected AlignmentType |
loadAlignment(InputStream in,
IOReporter reporter)
Load a alignment representation from the given stream.
|
createAlignment, internalAddBaseAlignment
public JaxbToAlignment(AlignmentType alignment, IOReporter reporter, TypeIndex sourceTypes, TypeIndex targetTypes, PathUpdate updater)
alignment
- the alignment read using JAXBreporter
- where to report problems to, may be null
sourceTypes
- the source types for resolving source entitiestargetTypes
- the target types for resolving target entitiesupdater
- the path updater to use for base alignmentspublic static AlignmentType load(InputStream in, IOReporter reporter) throws JAXBException
AlignmentType
from an input stream. The stream is closed
at the end.in
- the input streamreporter
- the I/O reporter to report any errors to, may be
null
JAXBException
- if reading the alignment failedpublic static void addBaseAlignment(MutableAlignment alignment, URI newBase, URI projectLocation, TypeIndex sourceTypes, TypeIndex targetTypes, IOReporter reporter) throws IOException
alignment
- the alignment to add a base alignment tonewBase
- URI of the new base alignmentprojectLocation
- the project location or null
sourceTypes
- the source types to use for resolving definition
referencestargetTypes
- the target types to use for resolving definition
referencesreporter
- the I/O reporter to report any errors to, may be
null
IOException
- if adding the base alignment failspublic MutableAlignment convert() throws IOException
IOException
- if a base alignment couldn't be loadedprotected AlignmentType loadAlignment(InputStream in, IOReporter reporter) throws IOException
AbstractBaseAlignmentLoader
loadAlignment
in class AbstractBaseAlignmentLoader<AlignmentType,CellType,ModifierType>
in
- the input streamreporter
- the I/O reporter to report any errors to, may be
null
IOException
- if some kind of exception occurs while loading the
alignmentAbstractBaseAlignmentLoader.loadAlignment(java.io.InputStream,
eu.esdihumboldt.hale.common.core.io.report.IOReporter)
protected Map<String,URI> getBases(AlignmentType alignment)
AbstractBaseAlignmentLoader
getBases
in class AbstractBaseAlignmentLoader<AlignmentType,CellType,ModifierType>
alignment
- the alignment representation in questionAbstractBaseAlignmentLoader.getBases(java.lang.Object)
protected Collection<CellType> getCells(AlignmentType alignment)
AbstractBaseAlignmentLoader
getCells
in class AbstractBaseAlignmentLoader<AlignmentType,CellType,ModifierType>
alignment
- the alignment representation in questionAbstractBaseAlignmentLoader.getCells(java.lang.Object)
protected MutableCell createCell(CellType cell, TypeIndex sourceTypes, TypeIndex targetTypes, IOReporter reporter)
AbstractBaseAlignmentLoader
createCell
in class AbstractBaseAlignmentLoader<AlignmentType,CellType,ModifierType>
cell
- the cell representationsourceTypes
- the source types to use for resolving definition
referencestargetTypes
- the target types to use for resolving definition
referencesreporter
- the I/O reporter to report any errors to, may be
null
AbstractBaseAlignmentLoader.createCell(java.lang.Object,
eu.esdihumboldt.hale.common.schema.model.TypeIndex,
eu.esdihumboldt.hale.common.schema.model.TypeIndex,
eu.esdihumboldt.hale.common.core.io.report.IOReporter)
protected Collection<ModifierType> getModifiers(AlignmentType alignment)
AbstractBaseAlignmentLoader
getModifiers
in class AbstractBaseAlignmentLoader<AlignmentType,CellType,ModifierType>
alignment
- the alignment representation in questionAbstractBaseAlignmentLoader.getModifiers(java.lang.Object)
protected String getModifiedCell(ModifierType modifier)
AbstractBaseAlignmentLoader
getModifiedCell
in class AbstractBaseAlignmentLoader<AlignmentType,CellType,ModifierType>
modifier
- the modifier representation in questionAbstractBaseAlignmentLoader.getModifiedCell(java.lang.Object)
protected Collection<String> getDisabledForList(ModifierType modifier)
AbstractBaseAlignmentLoader
getDisabledForList
in class AbstractBaseAlignmentLoader<AlignmentType,CellType,ModifierType>
modifier
- the modifier representation in questionAbstractBaseAlignmentLoader.getDisabledForList(java.lang.Object)
protected TransformationMode getTransformationMode(ModifierType modifier)
AbstractBaseAlignmentLoader
getTransformationMode
in class AbstractBaseAlignmentLoader<AlignmentType,CellType,ModifierType>
modifier
- the modifiernull
if none is specifiedprotected String getCellId(CellType cell)
AbstractBaseAlignmentLoader
getCellId
in class AbstractBaseAlignmentLoader<AlignmentType,CellType,ModifierType>
cell
- the cell in questionAbstractBaseAlignmentLoader.getCellId(java.lang.Object)
Build 2013-10-07_11-27-38
Revision 99b27713a799a59a21b0b166eaaea8aaefbf125a