Class TLcyCompositePropertyConverter
- All Implemented Interfaces:
ILcyPropertyConverter
Composite implementation of ILcyPropertyConverter
. It has a list of associated
ILcyPropertyConverter
s, which are all used.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addPropertyConverter
(ILcyPropertyConverter aConverter) Adds the givenILcyPropertyConverter
to this composite implementation.void
convertAfterDecode
(ALcyProperties aPropertiesSFCT) Modifies the givenALcyProperties
so thatString
properties representingObject
s are converted to theseObject
s.void
convertBeforeEncode
(ALcyProperties aPropertiesSFCT) Modifies the givenALcyProperties
so that allObject
values are converted to one or moreString
values.getPropertyConverter
(int aIndex) Returns theILcyPropertyConverter
at the given index.int
Returns the amount of associatedILcyPropertyConverter
s.void
removePropertyConverter
(ILcyPropertyConverter aConverter) Remove the givenILcyPropertyConverter
from this composite implementation.
-
Constructor Details
-
TLcyCompositePropertyConverter
public TLcyCompositePropertyConverter()
-
-
Method Details
-
addPropertyConverter
Adds the givenILcyPropertyConverter
to this composite implementation.- Parameters:
aConverter
- theILcyPropertyConverter
to add. Must not benull
.- Throws:
IllegalArgumentException
- If the specified converter was already added before.NullPointerException
- If the specified converter wasnull
.
-
removePropertyConverter
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.- Parameters:
aConverter
- theILcyPropertyConverter
to remove.
-
getPropertyConverter
Returns theILcyPropertyConverter
at the given index.- Parameters:
aIndex
- the index to retrieve theILcyPropertyConverter
for. 0 < aIndex <getPropertyConverterCount()
- Returns:
- the
ILcyPropertyConverter
at the given index.
-
getPropertyConverterCount
public int getPropertyConverterCount()Returns the amount of associatedILcyPropertyConverter
s.- Returns:
- the amount of associated
ILcyPropertyConverter
s. - See Also:
-
convertBeforeEncode
Modifies the given
ALcyProperties
so that allObject
values are converted to one or moreString
values.This method should remove the original
Object
that it encodes. Only theString
property or properties should remain.This implementation performs the conversion by asking all associated
ILcyPropertyConverter
s to perform their conversions.- Specified by:
convertBeforeEncode
in interfaceILcyPropertyConverter
- Parameters:
aPropertiesSFCT
- TheALcyProperties
to modify. Nevernull
.
-
convertAfterDecode
Modifies the given
ALcyProperties
so thatString
properties representingObject
s are converted to theseObject
s.This method should remove the
String
properties from which it constructs theObject
. Only theObject
property should remain.This implementation performs the conversion by asking all associated
ILcyPropertyConverter
s to perform their conversions.- Specified by:
convertAfterDecode
in interfaceILcyPropertyConverter
- Parameters:
aPropertiesSFCT
- The properties to modify.
-