|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.mmm.util.xml.base.jaxb.IdResolverContext
public class IdResolverContext
This class is a context for 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.
This class solves the problem by tracking the each Callable and check
that in the end all are resolved successfully.
| Nested Class Summary | |
|---|---|
protected class |
IdResolverContext.Resolver
This inner class resolves an ID on demand. |
| Field Summary | |
|---|---|
private List<DuplicateObjectException> |
duplicateIdErrors
|
private Map<String,IdResolverContext.Resolver> |
id2callableMap
|
private Map<String,Object> |
id2valueMap
|
| Constructor Summary | |
|---|---|
IdResolverContext()
The constructor. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private Map<String,Object> id2valueMap
put(String, Object)private Map<String,IdResolverContext.Resolver> id2callableMap
get(String, Class)private List<DuplicateObjectException> duplicateIdErrors
put(String, Object)| Constructor Detail |
|---|
public IdResolverContext()
| Method Detail |
|---|
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.
id - is the XmlIDREF of the
requested object. This object should be bound. This may also happen after it has been requested.type - is the expected type of the object.
Callable that resolves the
requested value.
public void disposeAndValidate()
throws ObjectNotFoundException,
ComposedException
ObjectNotFoundException - if a single ID was NOT resolved.
ComposedException - if multiple IDs have NOT been resolved.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||