Class Restriction
- java.lang.Object
-
- com.rometools.modules.mediarss.types.Restriction
-
- All Implemented Interfaces:
Serializable
public class Restriction extends Object implements 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.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRestriction.RelationshipIndicates the action of the relationship.static classRestriction.TypeIndicated the type of the relationship.
-
Constructor Summary
Constructors Constructor Description Restriction(Restriction.Relationship relationship, Restriction.Type type, String value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Restriction.RelationshipgetRelationship()Restriction.TypegetType()StringgetValue()inthashCode()StringtoString()
-
-
-
Constructor Detail
-
Restriction
public Restriction(Restriction.Relationship relationship, Restriction.Type type, String value)
- Parameters:
relationship- a Restriction.Relationship objecttype- A Restriction.Type objectvalue- a value for the restriction.
-
-
Method Detail
-
getRelationship
public Restriction.Relationship getRelationship()
-
getType
public Restriction.Type getType()
-
getValue
public String getValue()
-
-