Class AudienceRestrictionImpl
- java.lang.Object
-
- com.sun.identity.saml2.assertion.impl.ConditionAbstractImpl
-
- com.sun.identity.saml2.assertion.impl.AudienceRestrictionImpl
-
- All Implemented Interfaces:
AudienceRestriction
,ConditionAbstract
public class AudienceRestrictionImpl extends ConditionAbstractImpl implements AudienceRestriction
TheAudienceRestriction
specifies that the assertion is addressed to one or more specificAudience
s.
-
-
Field Summary
Fields Modifier and Type Field Description static String
AUDIENCE_ELEMENT
static String
AUDIENCE_RESTRICTION_ELEMENT
-
Constructor Summary
Constructors Constructor Description AudienceRestrictionImpl()
Default constructorAudienceRestrictionImpl(String xml)
This constructor is used to buildAudienceRestriction
object from a XML string.AudienceRestrictionImpl(Element element)
This constructor is used to buildAudienceRestriction
object from a block of existing XML that has already been built into a DOM.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<String>
getAudience()
Returns a list ofString
represented audiencesboolean
isMutable()
Returns true if the object is mutablevoid
makeImmutable()
Makes the object immutablevoid
setAudience(List audiences)
Sets the audiencesString
toXMLString()
Returns a String representationString
toXMLString(boolean includeNSPrefix, boolean declareNS)
Returns a String representation
-
-
-
Constructor Detail
-
AudienceRestrictionImpl
public AudienceRestrictionImpl()
Default constructor
-
AudienceRestrictionImpl
public AudienceRestrictionImpl(String xml) throws SAML2Exception
This constructor is used to buildAudienceRestriction
object from a XML string.- Parameters:
xml
- Ajava.lang.String
representing aAudienceRestriction
object- Throws:
SAML2Exception
- if it could not process the XML string
-
AudienceRestrictionImpl
public AudienceRestrictionImpl(Element element) throws SAML2Exception
This constructor is used to buildAudienceRestriction
object from a block of existing XML that has already been built into a DOM.- Parameters:
element
- Aorg.w3c.dom.Element
representing DOM tree forAudienceRestriction
object- Throws:
SAML2Exception
- if it could not process the Element
-
-
Method Detail
-
getAudience
public List<String> getAudience()
Returns a list ofString
represented audiences- Specified by:
getAudience
in interfaceAudienceRestriction
- Returns:
- a list of
String
represented audiences
-
setAudience
public void setAudience(List audiences) throws SAML2Exception
Sets the audiences- Specified by:
setAudience
in interfaceAudienceRestriction
- Parameters:
audiences
- List of audiences as URI strings- Throws:
SAML2Exception
- if the object is immutable
-
toXMLString
public String toXMLString(boolean includeNSPrefix, boolean declareNS) throws SAML2Exception
Returns a String representation- Specified by:
toXMLString
in interfaceAudienceRestriction
- Specified by:
toXMLString
in interfaceConditionAbstract
- Parameters:
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.- Returns:
- A String representation
- Throws:
SAML2Exception
- if something is wrong during conversion
-
toXMLString
public String toXMLString() throws SAML2Exception
Returns a String representation- Specified by:
toXMLString
in interfaceAudienceRestriction
- Specified by:
toXMLString
in interfaceConditionAbstract
- Returns:
- A String representation
- Throws:
SAML2Exception
- if something is wrong during conversion
-
makeImmutable
public void makeImmutable()
Makes the object immutable- Specified by:
makeImmutable
in interfaceAudienceRestriction
- Specified by:
makeImmutable
in interfaceConditionAbstract
- Overrides:
makeImmutable
in classConditionAbstractImpl
-
isMutable
public boolean isMutable()
Returns true if the object is mutable- Specified by:
isMutable
in interfaceAudienceRestriction
- Specified by:
isMutable
in interfaceConditionAbstract
- Overrides:
isMutable
in classConditionAbstractImpl
- Returns:
- true if the object is mutable
-
-