public class Attribute extends Object
Constructor and Description |
---|
Attribute(URI id,
String issuer,
DateTimeAttribute issueInstant,
AttributeValue value,
boolean includeInResult,
int version)
Creates a new
Attribute of the type specified in the given
AttributeValue .for XACML 3 with one AttributeValue |
Attribute(URI id,
String issuer,
DateTimeAttribute issueInstant,
AttributeValue value,
int version)
Creates a new
Attribute for XACML 2 and XACML 1.X with one AttributeValue |
Attribute(URI id,
URI type,
String issuer,
DateTimeAttribute issueInstant,
List<AttributeValue> attributeValues,
boolean includeInResult,
int xacmlVersion)
Creates a new
Attribute |
Modifier and Type | Method and Description |
---|---|
String |
encode()
Encodes this
Attribute into its XML form |
void |
encode(StringBuilder builder)
Encodes this
Attribute into its XML form and writes this out to the provided
StringBuilder |
URI |
getId()
Returns the id of this attribute
|
static Attribute |
getInstance(Node root,
int version)
Creates an instance of an
Attribute based on the root DOM node of the XML data. |
DateTimeAttribute |
getIssueInstant()
Returns the moment at which the attribute was issued, or null if no issue time was provided
|
String |
getIssuer()
Returns the issuer of this attribute, or null if no issuer was named
|
URI |
getType()
Returns the data type of this attribute
|
AttributeValue |
getValue()
a
AttributeValue of this attribute,
or null if no value was included |
List<AttributeValue> |
getValues()
List of AttributeValue of this attribute,
or null if no value was included |
boolean |
isIncludeInResult()
Returns whether attribute must be present in response or not
|
public Attribute(URI id, String issuer, DateTimeAttribute issueInstant, AttributeValue value, boolean includeInResult, int version)
Attribute
of the type specified in the given
AttributeValue
.for XACML 3 with one AttributeValue
id
- the id of the attributeissuer
- the attribute's issuer or null if there is noneissueInstant
- the moment when the attribute was issued, or null if it's unspecifiedvalue
- the actual value associated with the attribute meta-dataincludeInResult
- whether to include this attribute in the result.version
- XACML versionpublic Attribute(URI id, String issuer, DateTimeAttribute issueInstant, AttributeValue value, int version)
Attribute
for XACML 2 and XACML 1.X with one AttributeValue
id
- the id of the attributeissuer
- the attribute's issuer or null if there is noneissueInstant
- the moment when the attribute was issued, or null if it's unspecifiedvalue
- actual List
of AttributeValue
associated withversion
- XACML versionpublic Attribute(URI id, URI type, String issuer, DateTimeAttribute issueInstant, List<AttributeValue> attributeValues, boolean includeInResult, int xacmlVersion)
Attribute
id
- the id of the attributetype
- the type of the attributeissuer
- the attribute's issuer or null if there is noneissueInstant
- the moment when the attribute was issued, or null if it's unspecifiedattributeValues
- actual List
of AttributeValue
associated withincludeInResult
- whether to include this attribute in the result.xacmlVersion
- xacml versionpublic static Attribute getInstance(Node root, int version) throws ParsingException
Attribute
based on the root DOM node of the XML data.root
- the DOM root of the AttributeType XML typeversion
- XACML versionParsingException
- throws ParsingException if the data is invalidpublic URI getId()
public URI getType()
public String getIssuer()
public DateTimeAttribute getIssueInstant()
public boolean isIncludeInResult()
public List<AttributeValue> getValues()
List
of AttributeValue
of this attribute,
or null if no value was includedpublic AttributeValue getValue()
AttributeValue
of this attribute,
or null if no value was includedpublic String encode()
Attribute
into its XML formString
public void encode(StringBuilder builder)
Attribute
into its XML form and writes this out to the provided
StringBuilder
builder
- string stream into which the XML-encoded data is writtenCopyright © 2021 WSO2. All rights reserved.