Class ContextPathEncoderImpl
- java.lang.Object
-
- org.apache.tapestry5.internal.services.ContextPathEncoderImpl
-
- All Implemented Interfaces:
ContextPathEncoder
public class ContextPathEncoderImpl extends java.lang.Object implements ContextPathEncoder
-
-
Constructor Summary
Constructors Constructor Description ContextPathEncoderImpl(ContextValueEncoder valueEncoder, URLEncoder urlEncoder, TypeCoercer typeCoercer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EventContextdecodePath(java.lang.String path)Inverse ofContextPathEncoder.encodeIntoPath(Object[]); the path is split into strings, and the string are decoded and constructed into anEventContext.java.lang.StringencodeIntoPath(java.lang.Object[] context)Encodes the context values into a path string.java.lang.StringencodeIntoPath(EventContext context)Encodes the context into a string.java.lang.StringencodeValue(java.lang.Object value)Encodes a single value via theContextValueEncoderservice, returning the resulting string.
-
-
-
Constructor Detail
-
ContextPathEncoderImpl
public ContextPathEncoderImpl(ContextValueEncoder valueEncoder, URLEncoder urlEncoder, TypeCoercer typeCoercer)
-
-
Method Detail
-
encodeValue
public java.lang.String encodeValue(java.lang.Object value)
Description copied from interface:ContextPathEncoderEncodes a single value via theContextValueEncoderservice, returning the resulting string. Even null is encoded, as perURLEncoder.encode(String).- Specified by:
encodeValuein interfaceContextPathEncoder
-
encodeIntoPath
public java.lang.String encodeIntoPath(java.lang.Object[] context)
Description copied from interface:ContextPathEncoderEncodes the context values into a path string. Each context value (if non-null) is first value encoded into a string via theContextValueEncoderservice. Those values are then encoded, viaURLEncoder.encode(String)into URL-safe strings. The URL-safe strings are then concatenated together, separated with "/" characters.- Specified by:
encodeIntoPathin interfaceContextPathEncoder- Parameters:
context- an array of objects to encode as the context (may be null)- Returns:
- the path-encoded context, or the blank string if the context is empty
-
encodeIntoPath
public java.lang.String encodeIntoPath(EventContext context)
Description copied from interface:ContextPathEncoderEncodes the context into a string. Returns the empty string if the context is empty.- Specified by:
encodeIntoPathin interfaceContextPathEncoder- Parameters:
context- to encode- Returns:
- encoded values separated by "/" characters, or the empty string
-
decodePath
public EventContext decodePath(java.lang.String path)
Description copied from interface:ContextPathEncoderInverse ofContextPathEncoder.encodeIntoPath(Object[]); the path is split into strings, and the string are decoded and constructed into anEventContext.- Specified by:
decodePathin interfaceContextPathEncoder- Parameters:
path- to decode, possibly empty or null- Returns:
- corresponding event context
-
-