public class ResourceImpl extends Object implements Resource
Resource
element specifies information about the
resource to which access is requested by listing a
sequence of Attribute
elements associated with the
resource. it may include ResourceContent
<xs:element name="Resource" type="xacml-context:ResourceType"/> <xs:complexType name="ResourceType"> <xs:sequence> <xs:element ref="xacml-context:ResourceContent" minOccurs="0"/> <xs:element ref="xacml-context:Attribute" minOccurs="0" maxOccurs="unbounded"/> <xs:sequence> <xs:complexType>
Constructor and Description |
---|
ResourceImpl()
Default constructor
|
ResourceImpl(Element element)
This constructor is used to build
resource object from a
block of existing XML that has already been built into a DOM. |
ResourceImpl(String xml)
This constructor is used to build
Resource object from a
XML string. |
Modifier and Type | Method and Description |
---|---|
List |
getAttributes()
Returns zero to many
Attribute elements of this object
If no attributes and present, empty List will be returned. |
Element |
getResourceContent()
Returns the ResourceConent
|
boolean |
isMutable()
Checks if the object is mutable
|
void |
makeImmutable()
Makes the object immutable
|
void |
setAttributes(List attributes)
Sets the
Attribute elements of this object |
void |
setResourceContent(Element resourceContent)
Sets the ResourceContent of this Resource
|
String |
toXMLString()
Returns a string representation of this object
|
String |
toXMLString(boolean includeNSPrefix,
boolean declareNS)
Returns a
String representation of this object |
public ResourceImpl()
public ResourceImpl(String xml) throws XACMLException
Resource
object from a
XML string.xml
- A java.lang.String
representing
a Resource
objectXACMLException
- if it could not process the XML stringpublic ResourceImpl(Element element) throws XACMLException
resource
object from a
block of existing XML that has already been built into a DOM.element
- A org.w3c.dom.Element
representing
DOM tree for Resource
objectXACMLException
- if it could not process the Elementpublic Element getResourceContent()
getResourceContent
in interface Resource
public void setResourceContent(Element resourceContent) throws XACMLException
setResourceContent
in interface Resource
resourceContent
- ResourceContent of this Resource.
ResourceContent is optional, so could be null.XACMLException
- if the object is immutable
An object is considered immutable
if
makeImmutable()
has been invoked on it. It can
be determined by calling isMutable
on the object.public List getAttributes()
Attribute
elements of this object
If no attributes and present, empty List
will be returned.
Typically a Resource
element will contain an
Attribute
with an AttributeId
of
"urn:oasis:names:tc:xacml:1.0:resource:resource-id". Each such
Attribute
SHALL be an absolute abd fully resolved
representation of the identity of the single resource to which
access is requested.getAttributes
in interface Resource
List
containing the Attribute
elements of this objectpublic void setAttributes(List attributes) throws XACMLException
Attribute
elements of this objectsetAttributes
in interface Resource
attributes
- Attribute
elements of this object
attributes could be an empty List
, if no attributes
are present.XACMLException
- if the object is immutable
An object is considered immutable
if
makeImmutable()
has been invoked on it. It can
be determined by calling isMutable
on the object.public String toXMLString(boolean includeNSPrefix, boolean declareNS) throws XACMLException
String
representation of this objecttoXMLString
in interface Resource
includeNSPrefix
- Determines whether or not the namespace qualifier
is prepended to the Element when converteddeclareNS
- Determines whether or not the namespace is declared
within the Element.XACMLException
- if conversion fails for any reasonpublic String toXMLString() throws XACMLException
toXMLString
in interface Resource
XACMLException
- if conversion fails for any reasonpublic void makeImmutable()
Resource
makeImmutable
in interface Resource
Copyright © 2010-2018, ForgeRock All Rights Reserved.