|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.sling.jcr.resource.internal.helper.Mapping
public class Mapping
The Mapping
class conveys the mapping configuration used by
the
JcrResourceResolverFactoryImpl
.
Field Summary | |
---|---|
static int |
BOTH
defines the 'both' direction |
static Mapping |
DIRECT
Simple mapper instance mapping path to URLs 1:1 in both directions |
static int |
INBOUND
defines the 'inbound' direction, that is mapping request path to item path |
static int |
OUTBOUND
defined the 'outbound' direction, that is mapping item path to URL path |
Constructor Summary | |
---|---|
Mapping(String config)
|
|
Mapping(String[] parts)
|
Method Summary | |
---|---|
String |
getFrom()
|
String |
getTo()
|
String |
mapHandle(String handle)
Replaces the prefix from by the new prefix to, if and only if handle starts with the from prefix. |
boolean |
mapsInbound()
Checks, if this mapping is defined for inbound mapping. |
boolean |
mapsOutbound()
Checks, if this mapping is defined for outbound mapping. |
String |
mapUri(String uriPath)
Replaces the prefix to by the new prefix from, if and only if uriPath starts with the to prefix. |
static String[] |
split(String map)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int INBOUND
public static final int OUTBOUND
public static final int BOTH
public static final Mapping DIRECT
Constructor Detail |
---|
public Mapping(String config)
public Mapping(String[] parts)
Method Detail |
---|
public String toString()
toString
in class Object
public String mapUri(String uriPath)
uriPath
starts with the to prefix.
If uriPath
does not start with the to prefix,
or if this mapping is not defined as a 'inward' mapping,
null
is returned.
uriPath
- The URI path for which to replace the to prefix
by the from prefix.
null
if the
uriPath
does not start with the to
prefix, or mapsInbound()
returns false
.public String mapHandle(String handle)
handle
starts with the from prefix.
If uriPath
does not start with the from prefix,
or if this mapping is not defined as a 'outward' mapping,
null
is returned.
handle
- The URI path for which to replace the from
prefix by the to prefix.
null
if the
handle
does not start with the from
prefix, or mapsOutbound()
returns false
.public String getFrom()
public String getTo()
public boolean mapsInbound()
true
if this mapping is defined for inbound
mapping; false
otherwisepublic boolean mapsOutbound()
true
if this mapping is defined for outbound
mapping; false
otherwisepublic static String[] split(String map)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |