|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
com.fatwire.cs.core.uri.AbstractAssembler.AssemblyContext
protected static class AbstractAssembler.AssemblyContext
This class is a wrapper over the Definition object. It also provides a storage location for context parameters for use while assembling the definition into a URI. This object also implements the Definition interface.
The default implementation is simply a thin wrapper over the input Definition object. Overriding classes, however, will likely need to extend this class so that they can include context parameters for specific parameters that the assembler needs. For example, if the pagename parameter is extracted from the definition then altered or split for inclusion in the URI, it may be helpful to store the derived value in the context so that it can be subsequently retrieved in each of the main worker methods (AbstractAssembler.getScheme(com.fatwire.cs.core.uri.AbstractAssembler.AssemblyContext), AbstractAssembler.getAuthority(com.fatwire.cs.core.uri.AbstractAssembler.AssemblyContext), AbstractAssembler.getPath(com.fatwire.cs.core.uri.AbstractAssembler.AssemblyContext), AbstractAssembler.getQuery(com.fatwire.cs.core.uri.AbstractAssembler.AssemblyContext), and AbstractAssembler.getFragment(com.fatwire.cs.core.uri.AbstractAssembler.AssemblyContext) without having to re-parse the definition each time. In addition, it may be helpful to simply override the methods that implement the Definition interface so that certain parameters can be intercepted and changed. For instance, to suppress rendermode in the url it might be helpful to override AbstractAssembler.AssemblyContext.getParameterNames(), to never include rendermode, and to override AbstractAssembler.AssemblyContext.getParameter(java.lang.String), and AbstractAssembler.AssemblyContext.getParameters(java.lang.String) so that when rendermode is passed, null is always returned. Similar techniques can be applied to other parameters as well.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.fatwire.cs.core.uri.Definition |
|---|
Definition.AppType, Definition.ContainerType, Definition.SatelliteContext |
| Field Summary |
|---|
| Fields inherited from interface com.fatwire.cs.core.uri.Definition |
|---|
LOG_NAME |
| Constructor Summary | |
|---|---|
protected |
AbstractAssembler.AssemblyContext(Definition def)Construct the simplest possible assembly context that wraps the input definition. |
| Method Summary | |
|---|---|
Definition.AppType |
getAppType()Get the app type. |
java.util.Collection |
getAttrbuteNames()Returns the keys of all the attributes. |
java.lang.Object |
getAttribute(java.lang.String name)Return an attribute with the given key. |
java.lang.String |
getAuthority()Get the authority. |
Definition.ContainerType |
getContainerType()Get the container type. |
java.lang.Object |
getContextParameter(java.lang.Object key)Method to return arbitrary context parameters for use by overriding classes during the assembly operations. |
java.lang.String |
getFragment()Get the uri fragment. |
protected Definition |
getOriginalDefinition()Method to return the original input definition object. |
java.lang.String |
getParameter(java.lang.String name)Get the specified parameter. |
java.util.Collection |
getParameterNames()Get the specified parameter names. |
java.lang.String[] |
getParameters(java.lang.String name)Get the specified parameters. |
Definition.SatelliteContext |
getSatelliteContext()Get the satellite context. |
java.lang.String |
getScheme()Get the scheme. |
boolean |
sessionEncode()Get session encode switch |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected AbstractAssembler.AssemblyContext(Definition def)
def -| Method Detail |
|---|
public java.lang.String getScheme()
getScheme in interface DefinitionURI.getScheme()public java.lang.String getAuthority()
getAuthority in interface DefinitionURI.getAuthority()public Definition.ContainerType getContainerType()
getContainerType in interface DefinitionContainerType}public Definition.AppType getAppType()
getAppType in interface Definition@link{AppType}public java.lang.String getParameter(java.lang.String name)
getParameter in interface Definitionname - parameter namepublic java.lang.String[] getParameters(java.lang.String name)
getParameters in interface Definitionname - parameter namepublic java.util.Collection getParameterNames()
getParameterNames in interface Definitionpublic java.lang.String getFragment()
getFragment in interface Definitionpublic java.lang.Object getAttribute(java.lang.String name)
DefinitiongetAttribute in interface Definitionname - attribute keypublic java.util.Collection getAttrbuteNames()
DefinitiongetAttrbuteNames in interface Definitionpublic boolean sessionEncode()
sessionEncode in interface Definitionpublic Definition.SatelliteContext getSatelliteContext()
getSatelliteContext in interface DefinitionSatelliteContext}protected final Definition getOriginalDefinition()
AbstractAssembler class.public java.lang.Object getContextParameter(java.lang.Object key)
This default implementation returns null.
key -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.