|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sage.orion.sdata.servlet.SDataResourceElement
public class SDataResourceElement
The new replacement for the ResourceEntity and all the other stuff that goes with it.
TODO Test for xsi:nil on all elements; complain if it makes no sense
TODO Allow for xsi to be some other name for the same namespace
TODO Remove linefeed/space in text? Maybe not. TODO Maybe it is about time this was refactored to a set of classes
Nested Class Summary | |
---|---|
static class |
SDataResourceElement.CDataCreator
Creator for the CData type of SDataResourceElement |
static class |
SDataResourceElement.FieldCreator
Creator for the Field resource type. |
static class |
SDataResourceElement.ReferenceCreator
Creator for the Field resource type. |
static class |
SDataResourceElement.ReferenceListCreator
Creator for the Reference List type of resource. |
static class |
SDataResourceElement.Type
TODO: Fill in Javadoc for Type. |
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_NAMESPACE
|
static java.lang.String |
NAMESPACE_SEPARATOR
|
static java.lang.String |
XSI_NIL
|
Constructor Summary | |
---|---|
SDataResourceElement(java.lang.String textCDATA)
|
|
SDataResourceElement(java.lang.String name,
java.util.List<SDataResourceElement> contents)
Construct a reference SDataResourceElement for a list of resources or a resource that has no key |
|
SDataResourceElement(java.lang.String name,
java.util.List<SDataResourceElement> contents,
java.lang.String key,
java.lang.String url)
Construct a reference one for a single resource (a foreign resource or each child of a list) |
|
SDataResourceElement(java.lang.String name,
java.lang.String value)
Construct a FIELD SDataResourceElement.Type SDataResourceElement given name and
value |
Method Summary | |
---|---|
java.util.Map<java.lang.String,SDataResourceElement> |
getContentMap()
Gets the contents in the form of a map. |
java.util.List<SDataResourceElement> |
getContents()
Get the list of SDataResourceElement contents associated with this
SDataResourceElement |
boolean |
getDeleteMissing()
Gets whether to delete missing resources or resources not included in the payload. |
boolean |
getIsDeleted()
Gets the isDeleted value of this resource. |
java.lang.String |
getKey()
get the key |
java.lang.String |
getName()
get the name |
java.util.List<SDataRelatedResource> |
getRelatedEntries()
Gets the list of related entries for the children that are not actually included |
SDataResourceElement.Type |
getType()
get the type |
java.lang.String |
getUrl()
get the url |
java.lang.String |
getValue()
return the value |
static SDataResourceElement |
newChildrenList(java.lang.String name,
java.lang.String url,
java.util.List<SDataResourceElement> contents)
Constructs a reference type instance of the SDataResourceElement
class that corresponds to a child list related resource |
static SDataResourceElement |
newReferenceListResource(java.lang.String name,
java.util.List<SDataResourceElement> contents,
boolean deleteMissing)
Construct a reference SDataResourceElement for a list of resources or a resource that has no key and specify whether missing entries are to be deleted. |
static SDataResourceElement |
newReferenceResource(java.lang.String name,
java.util.List<SDataResourceElement> contents,
java.lang.String key,
java.lang.String url,
boolean isDeleted)
Factory method to create SDataResourceElement representing a reference for a single resource (a foreign resource or each child of a list) and allow whether to be deleted. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_NAMESPACE
public static final java.lang.String NAMESPACE_SEPARATOR
public static final java.lang.String XSI_NIL
Constructor Detail |
---|
public SDataResourceElement(java.lang.String name, java.lang.String value)
SDataResourceElement.Type
SDataResourceElement
given name and
value
name
- of the fieldvalue
- of the fieldpublic SDataResourceElement(java.lang.String name, java.util.List<SDataResourceElement> contents, java.lang.String key, java.lang.String url)
name
- the name of the resourcecontents
- the contents of the resource; a mix of fields and
sub-resources/foreign resourceskey
- the primary key of the element, in string form. (The value used
as the sdata:key and passed as the resource selector value).url
- the url of the element, in string form. (The value used as the
sdata:url). This must already be fully percent-encoded.public SDataResourceElement(java.lang.String name, java.util.List<SDataResourceElement> contents)
name
- the name of the resourcecontents
- the contents of the resource. This will be a null reference if
the contents are to be excluded.public SDataResourceElement(java.lang.String textCDATA)
textCDATA
- the textCDATAMethod Detail |
---|
public static SDataResourceElement newReferenceResource(java.lang.String name, java.util.List<SDataResourceElement> contents, java.lang.String key, java.lang.String url, boolean isDeleted)
name
- the name of the resourcecontents
- the contents of the resource; a mix of fields and
sub-resources/foreign resourceskey
- the primary key of the element, in string form. (The value used
as the sdata:key and passed as the resource selector value).url
- the url of the element, in string form. (The value used as the
sdata:url). This must already be fully percent-encoded.isDeleted
- determines whether this resource should be deleted
SDataResourceElement
public static SDataResourceElement newReferenceListResource(java.lang.String name, java.util.List<SDataResourceElement> contents, boolean deleteMissing)
name
- the name of the resourcecontents
- the contents of the resource. This will be a null reference if
the contents are to be excluded.deleteMissing
- is used to specify whether to delete the missing resources.
SDataResourceElement
public static final SDataResourceElement newChildrenList(java.lang.String name, java.lang.String url, java.util.List<SDataResourceElement> contents)
SDataResourceElement
class that corresponds to a child list related resource
name
- the name of the resourceurl
- the URL that can provide a feed containing the content. The URL
must be fully percent-encoded already.contents
- either a null reference (if the actual content is not to be
included) or a list of the contents.
SDataResourceElement
public java.lang.String getName()
public java.lang.String getKey()
public java.lang.String getUrl()
public SDataResourceElement.Type getType()
public java.lang.String getValue()
SDataResourceElement
element.
java.lang.IllegalStateException
- if the type
of the element is not one that
has a valuepublic java.util.List<SDataResourceElement> getContents()
SDataResourceElement
contents associated with this
SDataResourceElement
java.lang.IllegalStateException
- if the type
of the element is not one that
has contentspublic java.util.List<SDataRelatedResource> getRelatedEntries()
public java.util.Map<java.lang.String,SDataResourceElement> getContentMap()
public boolean getDeleteMissing()
public boolean getIsDeleted()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |