public final class SrampAtomUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
protected static ArtifactType |
disambiguateExtendedType(org.jboss.resteasy.plugins.providers.atom.Entry entry,
ArtifactType artifactType)
Attempts to figure out whether we're dealing with an
ExtendedArtifactType or a
ExtendedDocument by looking for clues in the Entry. |
static ArtifactType |
getArtifactType(org.jboss.resteasy.plugins.providers.atom.Entry entry)
Figures out the S-RAMP artifact type for the given
Entry. |
protected static ArtifactType |
getArtifactTypeFromEntry(org.jboss.resteasy.plugins.providers.atom.Entry entry)
Figures out the S-RAMP artifact type for the given
Entry. |
protected static String |
getArtifactWrappedElementName(Element artifactWrapperElement) |
protected static Element |
getArtifactWrapperNode(org.jboss.resteasy.plugins.providers.atom.Entry entry)
Gets the XML node for the wrapper 'artifact' element from the
Entry. |
static <T> T |
unwrap(org.jboss.resteasy.plugins.providers.atom.Entry entry,
Class<T> clazz)
Unwrap some other jaxb object from its Atom Entry wrapper.
|
static AuditEntry |
unwrapAuditEntry(org.jboss.resteasy.plugins.providers.atom.Entry entry)
Unwraps the audit entry from the Atom Entry.
|
static RDF |
unwrapRDF(org.jboss.resteasy.plugins.providers.atom.Entry entry)
Unwraps the Ontology from the Atom Entry.
|
static BaseArtifactType |
unwrapSrampArtifact(ArtifactType artifactType,
Artifact artifact)
Unwraps the specific
BaseArtifactType from the S-RAMP Artifact wrapper
element. |
static BaseArtifactType |
unwrapSrampArtifact(ArtifactType artifactType,
org.jboss.resteasy.plugins.providers.atom.Entry entry)
Unwraps a specific
BaseArtifactType from the Atom Entry containing it. |
static BaseArtifactType |
unwrapSrampArtifact(org.jboss.resteasy.plugins.providers.atom.Entry entry)
Unwraps a specific
BaseArtifactType from the Atom Entry containing it. |
static org.jboss.resteasy.plugins.providers.atom.Entry |
wrapSrampArtifact(BaseArtifactType artifact)
Wraps the given s-ramp artifact in an Atom
Entry. |
public static BaseArtifactType unwrapSrampArtifact(ArtifactType artifactType, Artifact artifact)
BaseArtifactType from the S-RAMP Artifact wrapper
element. This method requires the artifact's type.artifactType - the s-ramp artifact typeartifact - the s-ramp wrapper ArtifactBaseArtifactTypepublic static BaseArtifactType unwrapSrampArtifact(org.jboss.resteasy.plugins.providers.atom.Entry entry)
BaseArtifactType from the Atom Entry containing it. This
method grabs the Artifact child from the Atom Entry and then unwraps the
BaseArtifactType from that.entry - an Atom EntryBaseArtifactTypepublic static BaseArtifactType unwrapSrampArtifact(ArtifactType artifactType, org.jboss.resteasy.plugins.providers.atom.Entry entry)
BaseArtifactType from the Atom Entry containing it. This
method grabs the Artifact child from the Atom Entry and then unwraps the
BaseArtifactType from that.artifactType - the s-ramp artifact typeentry - an Atom EntryBaseArtifactTypepublic static org.jboss.resteasy.plugins.providers.atom.Entry wrapSrampArtifact(BaseArtifactType artifact) throws URISyntaxException, IllegalArgumentException, IllegalAccessException, InvocationTargetException, SecurityException, NoSuchMethodException
Entry.artifact - URISyntaxExceptionInvocationTargetExceptionIllegalAccessExceptionIllegalArgumentExceptionNoSuchMethodExceptionSecurityExceptionpublic static ArtifactType getArtifactType(org.jboss.resteasy.plugins.providers.atom.Entry entry)
Entry.entry - protected static ArtifactType getArtifactTypeFromEntry(org.jboss.resteasy.plugins.providers.atom.Entry entry)
Entry. There are a number of
ways we can do this. We'll try them all:
1) check the 'self' link, parsing it for the type and model information
2) check the Atom Category - there should be one for the artifact type
3) unwrap the Entry's Artifact and get the artifactType value (xml attribute)entry - protected static ArtifactType disambiguateExtendedType(org.jboss.resteasy.plugins.providers.atom.Entry entry, ArtifactType artifactType)
ExtendedArtifactType or a
ExtendedDocument by looking for clues in the Entry.entry - artifactType - public static <T> T unwrap(org.jboss.resteasy.plugins.providers.atom.Entry entry,
Class<T> clazz)
throws JAXBException
entry - clazz - JAXBExceptionprotected static Element getArtifactWrapperNode(org.jboss.resteasy.plugins.providers.atom.Entry entry)
Entry.entry - protected static String getArtifactWrappedElementName(Element artifactWrapperElement)
artifactWrapperElement - Artifact wrapperpublic static RDF unwrapRDF(org.jboss.resteasy.plugins.providers.atom.Entry entry)
entry - public static AuditEntry unwrapAuditEntry(org.jboss.resteasy.plugins.providers.atom.Entry entry)
entry - Copyright © 2011-2013 JBoss, a division of Red Hat. All Rights Reserved.