Lizzy v1.1.1

christophedelory.rss.media
Class Restriction

java.lang.Object
  extended by christophedelory.rss.media.Restriction

public class Restriction
extends Object

Allows restrictions to be placed on the aggregator rendering the media in the feed. Currently, restrictions are based on distributor (uri) and country codes. This element is purely informational and no obligation can be assumed or implied. Only one media restriction element of the same type can be applied to a media object - all others will be ignored. Entities in this element should be space separated. To allow the producer to explicitly declare his/her intentions, two literals are reserved: 'all', 'none'. These literals can only be used once.
Example:

 <media:restriction relationship="allow" type="country">au us</media:restriction>
 
Note: if the restriction element is empty and the type of relationship is "allow", it is assumed that the empty list means "allow nobody" and the media should not be syndicated.

Version:
$Revision: 92 $
Author:
Christophe Delory

Constructor Summary
Restriction()
           
 
Method Summary
 String getRelationship()
          Returns the type of relationship that the restriction represents (allow | deny).
 String getType()
          Returns the type of restriction (country | uri) that the media can be syndicated.
 String getValue()
          Returns the restriction itself.
 void setRelationship(String relationship)
          Initializes the type of relationship that the restriction represents (allow | deny).
 void setType(String type)
          Initializes the type of restriction (country | uri) that the media can be syndicated.
 void setValue(String value)
          Initializes the restriction itself.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Restriction

public Restriction()
Method Detail

getValue

public String getValue()
Returns the restriction itself.

Returns:
the restriction. May be null.
See Also:
setValue(java.lang.String)

setValue

public void setValue(String value)
Initializes the restriction itself.

Parameters:
value - the restriction. May be null.
See Also:
getValue()

getType

public String getType()
Returns the type of restriction (country | uri) that the media can be syndicated. It is an optional attribute; however can only be excluded when using one of the literal values "all" or "none".

Returns:
the type of restriction. May be null.
See Also:
setType(java.lang.String)

setType

public void setType(String type)
Initializes the type of restriction (country | uri) that the media can be syndicated.

Parameters:
type - the type of restriction. May be null.
See Also:
getType()

getRelationship

public String getRelationship()
Returns the type of relationship that the restriction represents (allow | deny). In the example above, the media object should only be syndicated in Australia and the United States.
Note: if the restriction element is empty and the type of relationship is "allow", it is assumed that the empty list means "allow nobody" and the media should not be syndicated.

Returns:
the relationship type. May be null if not yet initialized.
See Also:
setRelationship(java.lang.String)

setRelationship

public void setRelationship(String relationship)
Initializes the type of relationship that the restriction represents (allow | deny).

Parameters:
relationship - the relationship type. Shall not be null.
Throws:
NullPointerException - if relationship is null.
See Also:
getRelationship()

© 2008-2009 Christophe Delory

Copyright © 2008-2009 Christophe Delory. All Rights Reserved.