Skip navigation links
com.fatwire.cs.core.uri
Class AbstractAssembler.DisassemblyContext
java.lang.Object
com.fatwire.cs.core.uri.AbstractAssembler.DisassemblyContext
- Direct Known Subclasses:
- QueryAsPathInfoAssembler.QAPIDisassemblyContext
- Enclosing class:
- AbstractAssembler
-
protected static class AbstractAssembler.DisassemblyContext
- extends java.lang.Object
This class is a wrapper over the incoming URI that contains an accessor to arbitrary context parameters that extending classes can specify. It also provides access to an ownership flag that is checked during the disassembly process. If a URI is determined to be foreign, the flag should be tripped and disassembly will cease. Similar to the AbstractAssembler.AssemblyContext
, this class is handy for handling the state of a partially or wholly- decoded URI until the individual components are requested. Overriding assemblers will probably need to extend this class to maintain interim information. For example, an assembler that looks for a pattern such as "/foo/bar" may decode this to indicate that this is a ContentServer page rendering an asset type called "Bar" in the site "Foo" and that cid should be set to a value defined in a property file. This information can be stored in the DisassemblyContext for use in AbstractAssembler.getQuery(DisassemblyContext)
method.
Method Summary |
java.lang.Object |
getContextParameter(java.lang.Object key)
Accessor method for arbitrary context parameters. |
java.net.URI |
getURI()
Returns the original input URI belonging to the context. |
boolean |
isForeign()
This flag represents the ownership of the URI being decoded. |
void |
setForeign()
This flag represents the ownership of the URI being decoded. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractAssembler.DisassemblyContext
protected AbstractAssembler.DisassemblyContext(java.net.URI uri)
setForeign
public final void setForeign()
- This flag represents the ownership of the URI being decoded. Foreign URIs can not be decoded by this assembler. Through the decoding process, it may become evident that the ownership of a URI is foreign. If this method is ever set to indicate that ownership is foreign, then URI disassembly will cease.
-
- See Also:
AbstractAssembler.disassemble(URI, Definition.ContainerType)
isForeign
public final boolean isForeign()
- This flag represents the ownership of the URI being decoded. Foreign URIs can not be decoded by this assembler. Through the decoding process, it may become evident that the ownership of a URI is foreign. If this method is ever set to indicate that ownership is foreign, then URI disassembly will cease.
-
- See Also:
AbstractAssembler.disassemble(URI, Definition.ContainerType)
getURI
public final java.net.URI getURI()
- Returns the original input URI belonging to the context.
-
- Returns:
- uri
getContextParameter
public java.lang.Object getContextParameter(java.lang.Object key)
- Accessor method for arbitrary context parameters. The default implementation always returns null. Overriding classes can use this method as needed.
-
- Parameters:
key
-
- Returns:
- null always (this implementation), otherwise, the context parameter corresponding to the key specified.
Skip navigation links
Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.