public class PropertyTransformer extends Object
DockableProperty
, assuming that a factory is installed for the property.Modifier and Type | Field and Description |
---|---|
static Path |
FACTORY_EXTENSION
Name of the
ExtensionName that allows to load additional DockablePropertyFactory s |
static String |
FACTORY_EXTENSION_PARAMETER
Name of the only property of an
ExtensionName that points to this |
Constructor and Description |
---|
PropertyTransformer(DockController controller)
Creates a new transformer, the factories for all
DockableProperty s implemented
by this framework are installed. |
PropertyTransformer(DockController controller,
DockablePropertyFactory... factories)
Creates a new transformer and installs
factories . |
Modifier and Type | Method and Description |
---|---|
void |
addFactory(DockablePropertyFactory factory)
Installs a factory
|
DockableProperty |
read(DataInputStream in)
Reads a property which was earlier stored.
|
DockableProperty |
readXML(XElement element)
Reads a
DockableProperty and its successors from an xml element. |
void |
write(DockableProperty property,
DataOutputStream out)
Writes
property and all its successors into out . |
void |
writeXML(DockableProperty property,
XElement element)
Writes
property and all its successors into
element . |
public static final Path FACTORY_EXTENSION
ExtensionName
that allows to load additional DockablePropertyFactory
spublic static final String FACTORY_EXTENSION_PARAMETER
ExtensionName
that points to this
public PropertyTransformer(DockController controller)
DockableProperty
s implemented
by this framework are installed.controller
- the controller in whose realm this transformer is usedpublic PropertyTransformer(DockController controller, DockablePropertyFactory... factories)
factories
.factories
- a list of factories to installcontroller
- the controller in whose realm this transformer is usedpublic void addFactory(DockablePropertyFactory factory)
factory
- the new factorypublic void write(DockableProperty property, DataOutputStream out) throws IOException
property
and all its successors into out
.property
- the property to writeout
- a stream to write intoIOException
- if the stream throws an exceptionpublic DockableProperty read(DataInputStream in) throws IOException
in
- a stream to read fromIOException
- if the property can't be readpublic void writeXML(DockableProperty property, XElement element)
property
and all its successors into
element
.property
- the property to writeelement
- an xml element to which this method will add some childrenpublic DockableProperty readXML(XElement element)
DockableProperty
and its successors from an xml element.element
- the element to read fromnull
if element
is emptyIllegalArgumentException
- if a DockablePropertyFactory
is missing.