public class TLcyCompositePropertyConverter extends Object implements ILcyPropertyConverter
Composite implementation of ILcyPropertyConverter
. It has a list of associated
ILcyPropertyConverter
s, which are all used.
Constructor and Description |
---|
TLcyCompositePropertyConverter() |
Modifier and Type | Method and Description |
---|---|
void |
addPropertyConverter(ILcyPropertyConverter aConverter)
Adds the given
ILcyPropertyConverter to this composite implementation. |
void |
convertAfterDecode(ALcyProperties aPropertiesSFCT)
Modifies the given
ALcyProperties so that String properties
representing Object s are converted to these Object s. |
void |
convertBeforeEncode(ALcyProperties aPropertiesSFCT)
Modifies the given
ALcyProperties so that all Object values are
converted to one or more String values. |
ILcyPropertyConverter |
getPropertyConverter(int aIndex)
Returns the
ILcyPropertyConverter at the given index. |
int |
getPropertyConverterCount()
Returns the amount of associated
ILcyPropertyConverter s. |
void |
removePropertyConverter(ILcyPropertyConverter aConverter)
Remove the given
ILcyPropertyConverter from this composite implementation. |
public void addPropertyConverter(ILcyPropertyConverter aConverter)
ILcyPropertyConverter
to this composite implementation.aConverter
- the ILcyPropertyConverter
to add. Must not be null
.IllegalArgumentException
- If the specified converter was already added before.NullPointerException
- If the specified converter was null
.public void removePropertyConverter(ILcyPropertyConverter aConverter)
Remove the given ILcyPropertyConverter
from this composite implementation.
If this composite converter did not contain the specified converter, no exception is thrown
and nothing else happens.
aConverter
- the ILcyPropertyConverter
to remove.public ILcyPropertyConverter getPropertyConverter(int aIndex)
ILcyPropertyConverter
at the given index.aIndex
- the index to retrieve the ILcyPropertyConverter
for. 0 < aIndex
< getPropertyConverterCount()
ILcyPropertyConverter
at the given index.public int getPropertyConverterCount()
ILcyPropertyConverter
s.ILcyPropertyConverter
s.getPropertyConverter(int)
public void convertBeforeEncode(ALcyProperties aPropertiesSFCT)
Modifies the given ALcyProperties
so that all Object
values are
converted to one or more String
values.
This method should remove the original Object
that it encodes. Only the
String
property or properties should remain.
This implementation performs the conversion by asking all associated
ILcyPropertyConverter
s to perform their conversions.
convertBeforeEncode
in interface ILcyPropertyConverter
aPropertiesSFCT
- The ALcyProperties
to modify. Never null
.public void convertAfterDecode(ALcyProperties aPropertiesSFCT)
Modifies the given ALcyProperties
so that String
properties
representing Object
s are converted to these Object
s.
This method should remove the String
properties from which it constructs the
Object
. Only the Object
property should remain.
This implementation performs the conversion by asking all associated
ILcyPropertyConverter
s to perform their conversions.
convertAfterDecode
in interface ILcyPropertyConverter
aPropertiesSFCT
- The properties to modify.