com.sun.syndication.feed.module.mediarss.types
Class Restriction

java.lang.Object
  extended by com.sun.syndication.feed.module.mediarss.types.Restriction
All Implemented Interfaces:
java.io.Serializable

public class Restriction
extends java.lang.Object
implements java.io.Serializable

<media:restriction>

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. This element has 1 required attribute, and 1 optional attribute (with strict requirements for its exclusion).

        <media:restriction relationship="allow" type="country">au us</media:restriction>

relationship indicates 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. It is a required attribute.

Note: If the "allow" element is empty and the type is relationship is "allow", it is assumed that the empty list means "allow nobody" and the media should not be syndicated.

A more explicit method would be:

        <media:restriction relationship="allow" type="country">au us</media:restriction>

type specifies 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".

"country" allows restrictions to be placed based on country code. [ISO 3166]

"uri" allows restrictions based on URI. Examples: urn:apple, http://images.google.com, urn:yahoo, etc.

Author:
cooper
See Also:
Serialized Form

Nested Class Summary
static class Restriction.Relationship
          Indicates the action of the relationship
static class Restriction.Type
          Indicated the type of the relationship
 
Constructor Summary
Restriction(Restriction.Relationship relationship, Restriction.Type type, java.lang.String value)
          Creates a new instance of Restriction
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 Restriction.Relationship getRelationship()
           
 Restriction.Type getType()
           
 java.lang.String getValue()
           
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Restriction

public Restriction(Restriction.Relationship relationship,
                   Restriction.Type type,
                   java.lang.String value)
Creates a new instance of Restriction

Parameters:
relationship - a Restriction.Relationship object
type - A Restriction.Type object
value - a value for the restriction.
Method Detail

getRelationship

public Restriction.Relationship getRelationship()

getType

public Restriction.Type getType()

getValue

public java.lang.String getValue()

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2006-2009. All Rights Reserved.