public class AlignmentBean extends AbstractBaseAlignmentLoader<AlignmentBean,CellBean,ModifierBean>
Constructor and Description |
---|
AlignmentBean()
Default constructor
|
AlignmentBean(Alignment alignment,
PathUpdate pathUpdate)
Create a bean for the given alignment
|
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 |
createAlignment(IOReporter reporter,
TypeIndex sourceTypes,
TypeIndex targetTypes,
PathUpdate updater)
Create an alignment from the information in the bean.
|
protected MutableCell |
createCell(CellBean cell,
TypeIndex sourceTypes,
TypeIndex targetTypes,
IOReporter reporter)
Create a cell from the given cell representation
|
Map<String,URI> |
getBase() |
protected Map<String,URI> |
getBases(AlignmentBean alignment)
Returns a map of prefix, URI pairs of base alignments for the given
alignment.
|
protected String |
getCellId(CellBean cell)
Returns the cell id of the given cell.
|
Collection<CellBean> |
getCells()
Get the defined cells
|
protected Collection<CellBean> |
getCells(AlignmentBean alignment)
Returns a collection of cell representations of the given alignment
representation.
|
protected Collection<String> |
getDisabledForList(ModifierBean modifier)
Returns the disabled for list of the given modifier representation.
|
protected String |
getModifiedCell(ModifierBean modifier)
Returns the raw cell id that is modified by the given modifier.
|
Collection<ModifierBean> |
getModifiers()
Get the alignment modifiers
|
protected Collection<ModifierBean> |
getModifiers(AlignmentBean alignment)
Returns a collection of modifier representations of the given alignment
representation.
|
protected TransformationMode |
getTransformationMode(ModifierBean modifier)
Get the transformation mode specified in a modifier.
|
static AlignmentBean |
load(InputStream in,
IOReporter reporter)
Load an AlignmentBean from an input stream.
|
protected AlignmentBean |
loadAlignment(InputStream in,
IOReporter reporter)
Load a alignment representation from the given stream.
|
void |
setBase(Map<String,URI> base) |
void |
setCells(Collection<CellBean> cells)
Set the defined cells
|
void |
setModifiers(Collection<ModifierBean> modifiers)
Set the alignment modifiers
|
createAlignment, internalAddBaseAlignment
public AlignmentBean()
public AlignmentBean(Alignment alignment, PathUpdate pathUpdate)
alignment
- the alignmentpathUpdate
- to update relative paths in case of a path changepublic static AlignmentBean load(InputStream in, IOReporter reporter) throws org.exolab.castor.mapping.MappingException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
in
- the input streamreporter
- the I/O reporter to report any errors to, may be
null
org.exolab.castor.mapping.MappingException
- if the mapping could not be loadedorg.exolab.castor.xml.MarshalException
- if the alignment could not be readorg.exolab.castor.xml.ValidationException
- if the input stream did not provide valid XMLpublic 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 createAlignment(IOReporter reporter, TypeIndex sourceTypes, TypeIndex targetTypes, PathUpdate updater) throws IOException
reporter
- the I/O reporter to report any errors to, may be
null
sourceTypes
- the source types to use for resolving definition
referencestargetTypes
- the target types to use for resolving definition
referencesupdater
- the path updater to use for base alignmentsIOException
- if creating the alignment failspublic Collection<CellBean> getCells()
public void setCells(Collection<CellBean> cells)
cells
- the cells to setpublic Collection<ModifierBean> getModifiers()
public void setModifiers(Collection<ModifierBean> modifiers)
modifiers
- the modifiers to setprotected AlignmentBean loadAlignment(InputStream in, IOReporter reporter) throws IOException
AbstractBaseAlignmentLoader
loadAlignment
in class AbstractBaseAlignmentLoader<AlignmentBean,CellBean,ModifierBean>
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(AlignmentBean alignment)
AbstractBaseAlignmentLoader
getBases
in class AbstractBaseAlignmentLoader<AlignmentBean,CellBean,ModifierBean>
alignment
- the alignment representation in questionAbstractBaseAlignmentLoader.getBases(java.lang.Object)
protected Collection<CellBean> getCells(AlignmentBean alignment)
AbstractBaseAlignmentLoader
getCells
in class AbstractBaseAlignmentLoader<AlignmentBean,CellBean,ModifierBean>
alignment
- the alignment representation in questionAbstractBaseAlignmentLoader.getCells(java.lang.Object)
protected MutableCell createCell(CellBean cell, TypeIndex sourceTypes, TypeIndex targetTypes, IOReporter reporter)
AbstractBaseAlignmentLoader
createCell
in class AbstractBaseAlignmentLoader<AlignmentBean,CellBean,ModifierBean>
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<ModifierBean> getModifiers(AlignmentBean alignment)
AbstractBaseAlignmentLoader
getModifiers
in class AbstractBaseAlignmentLoader<AlignmentBean,CellBean,ModifierBean>
alignment
- the alignment representation in questionAbstractBaseAlignmentLoader.getModifiers(java.lang.Object)
protected String getModifiedCell(ModifierBean modifier)
AbstractBaseAlignmentLoader
getModifiedCell
in class AbstractBaseAlignmentLoader<AlignmentBean,CellBean,ModifierBean>
modifier
- the modifier representation in questionAbstractBaseAlignmentLoader.getModifiedCell(java.lang.Object)
protected Collection<String> getDisabledForList(ModifierBean modifier)
AbstractBaseAlignmentLoader
getDisabledForList
in class AbstractBaseAlignmentLoader<AlignmentBean,CellBean,ModifierBean>
modifier
- the modifier representation in questionAbstractBaseAlignmentLoader.getDisabledForList(java.lang.Object)
protected TransformationMode getTransformationMode(ModifierBean modifier)
AbstractBaseAlignmentLoader
getTransformationMode
in class AbstractBaseAlignmentLoader<AlignmentBean,CellBean,ModifierBean>
modifier
- the modifiernull
if none is specifiedprotected String getCellId(CellBean cell)
AbstractBaseAlignmentLoader
getCellId
in class AbstractBaseAlignmentLoader<AlignmentBean,CellBean,ModifierBean>
cell
- the cell in questionAbstractBaseAlignmentLoader.getCellId(java.lang.Object)
Build 2013-10-07_11-27-38
Revision 99b27713a799a59a21b0b166eaaea8aaefbf125a