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
TheAudienceRestrictionspecifies that the assertion is addressed to one or more specificAudiences.
-
-
Field Summary
Fields Modifier and Type Field Description static StringAUDIENCE_ELEMENTstatic StringAUDIENCE_RESTRICTION_ELEMENT
-
Constructor Summary
Constructors Constructor Description AudienceRestrictionImpl()Default constructorAudienceRestrictionImpl(String xml)This constructor is used to buildAudienceRestrictionobject from a XML string.AudienceRestrictionImpl(Element element)This constructor is used to buildAudienceRestrictionobject 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 ofStringrepresented audiencesbooleanisMutable()Returns true if the object is mutablevoidmakeImmutable()Makes the object immutablevoidsetAudience(List audiences)Sets the audiencesStringtoXMLString()Returns a String representationStringtoXMLString(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 buildAudienceRestrictionobject from a XML string.- Parameters:
xml- Ajava.lang.Stringrepresenting aAudienceRestrictionobject- Throws:
SAML2Exception- if it could not process the XML string
-
AudienceRestrictionImpl
public AudienceRestrictionImpl(Element element) throws SAML2Exception
This constructor is used to buildAudienceRestrictionobject from a block of existing XML that has already been built into a DOM.- Parameters:
element- Aorg.w3c.dom.Elementrepresenting DOM tree forAudienceRestrictionobject- Throws:
SAML2Exception- if it could not process the Element
-
-
Method Detail
-
getAudience
public List<String> getAudience()
Returns a list ofStringrepresented audiences- Specified by:
getAudiencein interfaceAudienceRestriction- Returns:
- a list of
Stringrepresented audiences
-
setAudience
public void setAudience(List audiences) throws SAML2Exception
Sets the audiences- Specified by:
setAudiencein 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:
toXMLStringin interfaceAudienceRestriction- Specified by:
toXMLStringin 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:
toXMLStringin interfaceAudienceRestriction- Specified by:
toXMLStringin interfaceConditionAbstract- Returns:
- A String representation
- Throws:
SAML2Exception- if something is wrong during conversion
-
makeImmutable
public void makeImmutable()
Makes the object immutable- Specified by:
makeImmutablein interfaceAudienceRestriction- Specified by:
makeImmutablein interfaceConditionAbstract- Overrides:
makeImmutablein classConditionAbstractImpl
-
isMutable
public boolean isMutable()
Returns true if the object is mutable- Specified by:
isMutablein interfaceAudienceRestriction- Specified by:
isMutablein interfaceConditionAbstract- Overrides:
isMutablein classConditionAbstractImpl- Returns:
- true if the object is mutable
-
-