| java.lang.Object | |
| ↳ | com.google.gdata.wireformats.AltRegistry |
The AltRegistry class maintains a registry of supported alternate representation formats along with the configuration of input and output handlers that will be used to process wire format content using the representations.
The registry supports a delegation model where lookup failures can be delegated to a different registry to support tiered lookup models. It also has a locking model to avoid changes occurring after initialization has been completed.
The class provides a locking model where the contents of the registry can be
made immutable using the lock() method. After this call, no
subsequent changes may be made to the registry and it is thread safe to
share across multiple threads.
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| altHandlers | Contains a mapping from an alt format instance to the configuration for the format | ||||||||||
| delegate | If non-null, contains a default registry that will be used as a delegate for all lookups that cannot be satisfied by this instance. | ||||||||||
| locked | If true, indicates that the registry is locked against further
changes. |
||||||||||
| nameMap | Contains a mapping from alt parameter name values to the associated format instance selected by each name. | ||||||||||
| typeMap | Contains a mapping from alt parameter media type names to an alt format that represents the alternate content representation type selected by the media type. | ||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a new AltRegistry with no default registry configuration.
| |||||||||||
Constructs a new AltRegistry with identical registration state to the
provided registry.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Returns the
OutputGenerator for the provided format or null
if the format is not registered. | |||||||||||
Returns the
InputParser for a format or null if the format
is not registered or does not support input parsing. | |||||||||||
Returns
true has an identical registration with the target
registry for the specified alt format. | |||||||||||
Locks the registry against further changes.
| |||||||||||
Returns the alt format that has been registered with the specified name.
| |||||||||||
Returns the alt format that has been registered with the specified content
type.
| |||||||||||
Registers the configuration for an
AltFormat, replacing any
existing configuration for the format in the registry. | |||||||||||
Returns a collection of all registered formats in the registry.
| |||||||||||
Sets a delegate registry that will be used to satisfy lookups that cannot
be resolved from the local registry.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Contains a mapping from an alt format instance to the configuration for the format
If non-null, contains a default registry that will be used as a delegate for all lookups that cannot be satisfied by this instance.
If true, indicates that the registry is locked against further
changes.
Contains a mapping from alt parameter name values to the associated format instance selected by each name.
Contains a mapping from alt parameter media type names to an alt format that represents the alternate content representation type selected by the media type.
Constructs a new AltRegistry with no default registry configuration.
Constructs a new AltRegistry with identical registration state to the
provided registry. If the input value is null, a clean registry
will be created.
| origRegistry | Registry containing default configuration that will be used for lookups that can't be satisfied by the local registry. |
|---|
Returns the OutputGenerator for the provided format or null
if the format is not registered.
| altFormat | Format to locate generator for. |
|---|
null.
Returns the InputParser for a format or null if the format
is not registered or does not support input parsing.
| altFormat | Format to locate parser for. |
|---|
null.
Returns true has an identical registration with the target
registry for the specified alt format. Currently, this is only true if
the copy constructor was used to do the initial registration and no
subsequent changes have been made.
| targetRegistry | Target registry to test |
|---|---|
| altFormat | Alt format to test |
true if registration for format is the same.
Locks the registry against further changes. Any attempts to call the
register(AltFormat, InputParser, OutputGenerator) API
after lock has been called will fail.
Returns the alt format that has been registered with the specified name.
| name | Format name. |
|---|
null.
Returns the alt format that has been registered with the specified content type.
| contentType | Type to look up. |
|---|
null.
Registers the configuration for an AltFormat, replacing any
existing configuration for the format in the registry.
| format | Format to register |
|---|---|
| parser | Input parser to use for the format (or null if not
supported for input. |
| generator | Output generator to use for the format. |
| IllegalStateException | if registry has been locked. |
|---|
Returns a collection of all registered formats in the registry. The collection does not include any values from the default registry provided at construction time.
Sets a delegate registry that will be used to satisfy lookups that cannot be resolved from the local registry.
| delegate | Delegate registry. |
|---|