public class OutputWriteSettings extends AnchorBean<OutputWriteSettings>
It is very important that initialize(org.anchoranalysis.bean.BeanInstanceMap)
is run before using the bean. This normally
occurs from checkMisconfigured() that is called automatically from the bean-loading framework
However, if the bean is not loaded through this mechanism, please call initialize(org.anchoranalysis.bean.BeanInstanceMap)
explicitly before usage.
Constructor and Description |
---|
OutputWriteSettings() |
Modifier and Type | Method and Description |
---|---|
void |
checkMisconfigured(BeanInstanceMap defaultInstances)
Checks that a bean's properties conform to expectations.
|
ColorIndex |
defaultColorIndexFor(int numberColors) |
ColorScheme |
getDefaultColors()
The default color-scheme used for outputs, if no other scheme is specified.
|
<T> Optional<T> |
getWriterInstance(Class<? extends T> writerFamilyType)
Gets a writer-instance for a particular
writerParentClass . |
List<NamedBean<?>> |
getWriters()
Specifies a writer bean instance for a particular type of writer (identified by the writer
bean class)
|
boolean |
hasBeenInitialized() |
void |
initialize(BeanInstanceMap defaultInstances) |
void |
setDefaultColors(ColorScheme defaultColors)
The default color-scheme used for outputs, if no other scheme is specified.
|
void |
setWriters(List<NamedBean<?>> writers)
Specifies a writer bean instance for a particular type of writer (identified by the writer
bean class)
|
describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
public void checkMisconfigured(BeanInstanceMap defaultInstances) throws BeanMisconfiguredException
AnchorBean
checkMisconfigured
in class AnchorBean<OutputWriteSettings>
defaultInstances
- all available default instances if the DefaultInstance
annotation is usedBeanMisconfiguredException
- if the bean has not been configured properly as XMLpublic void initialize(BeanInstanceMap defaultInstances) throws BeanMisconfiguredException
BeanMisconfiguredException
public boolean hasBeenInitialized()
public <T> Optional<T> getWriterInstance(Class<? extends T> writerFamilyType)
writerParentClass
.
1. First, it looks for a match among the bean-field 'writers' 2. If no match is found, then it looks among the general default-instances 3. If no match is found, then it returns null.
When a writer is returned, it will always inherits from type c.
writerFamilyType
- the class identifying which type of writer is soughtpublic ColorIndex defaultColorIndexFor(int numberColors) throws OperationFailedException
OperationFailedException
public ColorScheme getDefaultColors()
public void setDefaultColors(ColorScheme defaultColors)
public List<NamedBean<?>> getWriters()
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.