Top Description Fields Constructors Methods
net.fortuna.ical4j.model

public Class PropertyCodec

extends Object
implements StringEncoder, StringDecoder
Class Inheritance
All Implemented Interfaces
org.apache.commons.codec.StringDecoder, org.apache.commons.codec.Decoder, org.apache.commons.codec.StringEncoder, org.apache.commons.codec.Encoder
Imports
org.apache.commons.codec.DecoderException, .EncoderException, .StringDecoder, .StringEncoder, java.util.regex.Pattern

Support for encoding/decoding property values that include quotes, newlines, and escape characters.

Field Summary

Modifier and TypeField and Description
private static final Pattern
private static final String
private static final Pattern
private static final String
private static final Pattern
private static final Pattern
public static final PropertyCodec
private static final Pattern
private static final Pattern

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
decode(String
the String to decode
source
)

Implements org.apache.commons.codec.StringDecoder.decode.

Decodes a String and returns a String.

public Object
decode(Object
the object to decode
source
)

Implements org.apache.commons.codec.Decoder.decode.

Decodes an "encoded" Object and returns a "decoded" Object.

public String
encode(String
the String to encode
source
)

Implements org.apache.commons.codec.StringEncoder.encode.

Encodes a String and returns a String.

public Object
encode(Object
An object to encode
source
)

Implements org.apache.commons.codec.Encoder.encode.

Encodes an "Object" and returns the encoded content as an Object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BACKSLASH_EXback to summary
private static final Pattern BACKSLASH_EX
ENCODED_BACKSLASHback to summary
private static final String ENCODED_BACKSLASH
ENCODED_BACKSLASH_EXback to summary
private static final Pattern ENCODED_BACKSLASH_EX
ENCODED_NEWLINEback to summary
private static final String ENCODED_NEWLINE
ENCODED_NEWLINE_EXback to summary
private static final Pattern ENCODED_NEWLINE_EX
ENCODED_SPECIALCHAR_EXback to summary
private static final Pattern ENCODED_SPECIALCHAR_EX
INSTANCEback to summary
public static final PropertyCodec INSTANCE
NEWLINE_EXback to summary
private static final Pattern NEWLINE_EX
SPECIALCHAR_EXback to summary
private static final Pattern SPECIALCHAR_EX

Constructor Detail

PropertyCodecback to summary
public PropertyCodec()

Method Detail

decodeback to summary
public String decode(String source) throws DecoderException

Implements org.apache.commons.codec.StringDecoder.decode.

Doc from org.apache.commons.codec.StringDecoder.decode.

Decodes a String and returns a String.

Parameters
source:String

the String to decode

Returns:String

the encoded String

Annotations
@Override
Exceptions
DecoderException:
thrown if there is an error condition during the Encoding process.
decodeback to summary
public Object decode(Object source) throws DecoderException

Implements org.apache.commons.codec.Decoder.decode.

Doc from org.apache.commons.codec.Decoder.decode.

Decodes an "encoded" Object and returns a "decoded" Object. Note that the implementation of this interface will try to cast the Object parameter to the specific type expected by a particular Decoder implementation. If a ClassCastException occurs this decode method will throw a DecoderException.

Parameters
source:Object

the object to decode

Returns:Object

a 'decoded" object

Annotations
@Override
Exceptions
DecoderException:
a decoder exception can be thrown for any number of reasons. Some good candidates are that the parameter passed to this method is null, a param cannot be cast to the appropriate type for a specific encoder.
encodeback to summary
public String encode(String source) throws EncoderException

Implements org.apache.commons.codec.StringEncoder.encode.

Doc from org.apache.commons.codec.StringEncoder.encode.

Encodes a String and returns a String.

Parameters
source:String

the String to encode

Returns:String

the encoded String

Annotations
@Override
Exceptions
EncoderException:
thrown if there is an error condition during the encoding process.
encodeback to summary
public Object encode(Object source) throws EncoderException

Implements org.apache.commons.codec.Encoder.encode.

Doc from org.apache.commons.codec.Encoder.encode.

Encodes an "Object" and returns the encoded content as an Object. The Objects here may just be byte[] or Strings depending on the implementation used.

Parameters
source:Object

An object to encode

Returns:Object

An "encoded" Object

Annotations
@Override
Exceptions
EncoderException:
An encoder exception is thrown if the encoder experiences a failure condition during the encoding process.