|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.cedarsoft.rest.JaxbMapping<T,J,S>
T - the typeJ - the Jaxb typeS - the Jaxb stub typepublic abstract class JaxbMapping<T,J extends JaxbObject,S extends JaxbStub<J>>
| Constructor Summary | |
|---|---|
JaxbMapping()
|
|
| Method Summary | ||
|---|---|---|
protected abstract void |
copyFieldsToJaxbObject(T source,
J target,
UriContext context)
Copies the fields from the source to the target. |
|
protected abstract void |
copyFieldsToStub(T source,
S target,
UriContext context)
|
|
protected abstract J |
createJaxbObject(T object)
Creates the basic JaxbObject. |
|
protected J |
createJaxbObject(T object,
UriContext context)
Creates the jaxb object |
|
protected S |
createJaxbObjectStub(T object,
UriContext context)
Creates the JaxbObjectStub. |
|
protected abstract S |
createJaxbStub(T object)
Creates the basic stub. |
|
protected UriContext |
createLocalContext(UriContext context,
JaxbObject jaxbObject)
Creates the local context. |
|
protected
|
get(Class<J> jaxbType,
Iterable<? extends T> objects,
UriContext context)
|
|
protected
|
get(Class<J> jaxbType,
T object,
UriContext context)
|
|
DelegateJaxbMappings |
getDelegatesMapping()
|
|
J |
getJaxbObject(T object,
UriContext context)
|
|
List<J> |
getJaxbObjects(Iterable<? extends T> objects,
UriContext context)
|
|
S |
getJaxbObjectStub(T object,
UriContext context)
|
|
List<S> |
getJaxbStubs(Iterable<? extends T> objects,
UriContext context)
|
|
protected
|
getStub(Class<S> jaxbSubType,
Iterable<? extends T> objects,
UriContext context)
|
|
protected
|
getStub(Class<S> jaxbStubType,
T object,
UriContext context)
|
|
protected abstract javax.ws.rs.core.UriBuilder |
getUri(JaxbObject object,
UriContext context)
Returns the local URI for the object |
|
protected void |
setHref(JaxbObject jaxbObject,
UriContext context)
Sets the URI to the jaxb object. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JaxbMapping()
| Method Detail |
|---|
@NotNull public DelegateJaxbMappings getDelegatesMapping()
@NotNull
public S getJaxbObjectStub(@NotNull
T object,
@NotNull
UriContext context)
@NotNull
public J getJaxbObject(@NotNull
T object,
@NotNull
UriContext context)
@Nullable
protected <T,J extends JaxbObject> J get(@NotNull
Class<J> jaxbType,
@Nullable
T object,
@NotNull
UriContext context)
@Nullable
protected <T,J extends JaxbObject> List<J> get(@NotNull
Class<J> jaxbType,
@NotNull
Iterable<? extends T> objects,
@NotNull
UriContext context)
@Nullable
protected <T,J extends JaxbObject,S extends JaxbStub<J>> S getStub(@NotNull
Class<S> jaxbStubType,
@Nullable
T object,
@NotNull
UriContext context)
@Nullable
protected <T,J extends JaxbObject,S extends JaxbStub<J>> List<S> getStub(@NotNull
Class<S> jaxbSubType,
@NotNull
Iterable<? extends T> objects,
@NotNull
UriContext context)
@NotNull
public List<J> getJaxbObjects(@NotNull
Iterable<? extends T> objects,
@NotNull
UriContext context)
@NotNull
public List<S> getJaxbStubs(@NotNull
Iterable<? extends T> objects,
@NotNull
UriContext context)
@Nullable
protected UriContext createLocalContext(@NotNull
UriContext context,
@NotNull
JaxbObject jaxbObject)
context - the base context (not local!)jaxbObject - the jaxb object
@NotNull
protected final J createJaxbObject(@NotNull
T object,
@NotNull
UriContext context)
object - the objectcontext - the context
protected final S createJaxbObjectStub(@NotNull
T object,
@NotNull
UriContext context)
object - the objectcontext - the context
protected void setHref(@NotNull
JaxbObject jaxbObject,
@NotNull
UriContext context)
jaxbObject - the jaxb objectcontext - the context
@Nullable
protected abstract javax.ws.rs.core.UriBuilder getUri(@NotNull
JaxbObject object,
@NotNull
UriContext context)
object - the object (may be used to fetch the ID)context - the context
@NotNull
protected abstract J createJaxbObject(@NotNull
T object)
object - the object
@NotNull
protected abstract S createJaxbStub(@NotNull
T object)
object - the object
protected abstract void copyFieldsToJaxbObject(@NotNull
T source,
@NotNull
J target,
@NotNull
UriContext context)
getUri(JaxbObject, UriContext).
If that method returns null, there is no local context available and the given parameter is the context of the parent.
source - the source objecttarget - the target jaxb objectcontext - the (local) context.
protected abstract void copyFieldsToStub(@NotNull
T source,
@NotNull
S target,
@NotNull
UriContext context)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||