public class IdResolverContext extends Object
InternalValidatingIdResolver
. JAXB is a little strange: It is using a
Callable
for resolving XmlIDREF
but evaluates
it
immediately instead of storing it until the initial processing phase has been completed. If it returns null
it will try again later but never complains if the ID could not be resolved in the end. Callable
and check that in the end
all are resolved successfully.Modifier and Type | Class and Description |
---|---|
protected class |
IdResolverContext.Resolver
This inner class resolves an ID on demand.
|
Modifier and Type | Field and Description |
---|---|
private NlsBundleUtilExceptionRoot |
bundle
The bundle for creating error messages.
|
private List<NlsObject> |
duplicateIdErrors |
private Map<String,IdResolverContext.Resolver> |
id2callableMap |
private Map<String,Object> |
id2valueMap |
Constructor and Description |
---|
IdResolverContext()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
disposeAndValidate()
This method disposes this context and performs a validation that all IDs have been resolved.
|
Callable<?> |
get(String id,
Class<?> type)
This method
resolves the value with the given id
. |
void |
put(String id,
Object value)
This method
binds the given value with the given
id . |
private final NlsBundleUtilExceptionRoot bundle
private Map<String,Object> id2valueMap
put(String, Object)
private Map<String,IdResolverContext.Resolver> id2callableMap
get(String, Class)
private List<NlsObject> duplicateIdErrors
put(String, Object)
public void put(String id, Object value)
binds
the given value
with the given
id
.id
- is the XmlID
.value
- is the JAXB bean to bind.public Callable<?> get(String id, Class<?> type)
resolves
the value with the given id
.public void disposeAndValidate() throws ObjectNotFoundException, ComposedException
ObjectNotFoundException
- if a single ID was NOT resolved.ComposedException
- if multiple IDs have NOT been resolved.Copyright © 2001–2016 mmm-Team. All rights reserved.