public class MappingImpl extends Object implements Mapping
Default implementation of Mapping
. This implementation recognizes
patterns similar to URL mappings in the Servlet Specification:
If a view identifier matches, the corresponding resource identifier is
calculated by stripping the non-wildcard part of the view identifier
(/foo
or .foo
for the examples above) and
returning the remainder.
Constructor and Description |
---|
MappingImpl()
Construct an unconfigured instance.
|
MappingImpl(Mechanism mechanism,
String pattern,
Processor processor)
Construct a fully configured instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object object)
Two
Mapping s are equal if they have the same pattern. |
Mappings |
getMappings()
|
Mechanism |
getMechanism()
Return a description of the mechanism used to return the response
from this processor.
|
String |
getPattern()
Return the matching pattern for the view identifier for this
request, used to determine if this is the appropriate
Mapping
for processing the current request or not. |
Processor |
getProcessor()
Return the
Processor instance to be used to process
requests where the view identifier matches our pattern . |
int |
hashCode()
Return the hash code for this object.
|
String |
mapResourceId(javax.faces.context.FacesContext context,
String resourceId)
Map the specified resource identifier to a complete URL that may
be used to request this resource from the server.
|
String |
mapViewId(javax.faces.context.FacesContext context)
|
void |
setMappings(Mappings mappings)
|
void |
setMechanism(Mechanism mechanism)
Set the mechanism used by this mapping.
|
void |
setPattern(String pattern)
Set the matching pattern used by this mapping.
|
void |
setProcessor(Processor processor)
Set the
Processor instance used by this mapping. |
public Mappings getMappings()
getMappings
in interface Mapping
public void setMappings(Mappings mappings)
setMappings
in interface Mapping
mappings
- The new Mappings
instancepublic Mechanism getMechanism()
Return a description of the mechanism used to return the response from this processor. This value may be interpreted, for example, by a JavaServer Faces component that wishes to calculate an appropriate URL for a component specific resource that is packaged in a particular manner.
getMechanism
in interface Mapping
public void setMechanism(Mechanism mechanism)
Set the mechanism used by this mapping.
setMechanism
in interface Mapping
mechanism
- The new mechanismpublic String getPattern()
Return the matching pattern for the view identifier for this
request, used to determine if this is the appropriate Mapping
for processing the current request or not.
getPattern
in interface Mapping
public void setPattern(String pattern)
Set the matching pattern used by this mapping.
setPattern
in interface Mapping
pattern
- The new patternpublic Processor getProcessor()
Return the Processor
instance to be used to process
requests where the view identifier matches our pattern
.
getProcessor
in interface Mapping
public void setProcessor(Processor processor)
Set the Processor
instance used by this mapping.
setProcessor
in interface Mapping
processor
- The new Processor
instancepublic String mapResourceId(javax.faces.context.FacesContext context, String resourceId)
Map the specified resource identifier to a complete URL that may be used to request this resource from the server.
mapResourceId
in interface Mapping
context
- FacesContext
for the current requestresourceId
- Resource identifier to be mappedpublic String mapViewId(javax.faces.context.FacesContext context)
public int hashCode()
Return the hash code for this object.
Copyright © 2004-2013 Apache Software Foundation. All Rights Reserved.