org.apache.wink.common.categories
Class Categories

java.lang.Object
  extended by org.apache.wink.common.categories.Categories

public class Categories
extends java.lang.Object

The Atom Publishing Protocol introduces the notion of a "Category Document" and the app:categories element. These are used to provide a listing of atom:Category elements that may be used with the members of an Atom Publishing Protocol collection.


Constructor Summary
Categories()
          Constructor
Categories(java.util.List<AtomCategory> categories)
          Constructor
 
Method Summary
 Categories addCategory(AtomCategory category)
          Add an atom:Category to the listing
 AtomCategory addCategory(java.lang.String term)
          Create and add an atom:Category to the listing
 AtomCategory addCategory(java.lang.String scheme, java.lang.String term, java.lang.String label)
          Create an add an atom:Category to the listing
 boolean contains(java.lang.String term)
          Returns true if this app:categories listing contains a Category with the specified term
 boolean contains(java.lang.String term, java.lang.String scheme)
          Returns true if this app:categories listing contains a Category with the specified term and scheme
 java.util.List<AtomCategory> getCategories()
          Lists the complete set of categories
 java.util.List<AtomCategory> getCategories(java.lang.String scheme)
          Lists the complete set of categories that use the specified scheme
 java.lang.Class<?> getHandlingClass()
          Get Categories Document handling Resource class
 java.lang.Object getHandlingInstance()
          Get handling Bean for Categories Document
 java.lang.String getHref()
          When contained within an app:collection element, the app:categories element can have an href attribute whose value MUST point to an Atompub Categories Document.
 java.lang.String getScheme()
          The app:categories element may specify a default scheme attribute for listed atom:Category elements that do not have their own scheme attribute.
 javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> getTemplateParameters()
          Get Uri Template Variables
 boolean isFixed()
          If an app:categories element is marked as fixed, then the set of atom:Category elements is considered to be a closed set.
 boolean isOutOfLine()
          Returns true if the href attribute is set
 void setCategories(java.util.List<AtomCategory> categories)
          Set a list of categories
 Categories setFixed(boolean fixed)
          Sets whether or not this is a fixed listing of categories.
 void setHref(java.lang.Class<?> handlingClass, javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> templateParams)
          Set Resource class that will generate Categories Document
 void setHref(java.lang.Object handlingInstance, javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> templateParams)
          Set Resource that will generate Categories Document
 Categories setHref(java.lang.String href)
          Sets the value of the href attribute.
 Categories setScheme(java.lang.String scheme)
          Sets the default scheme for this listing of categories
 void setTemplateParameters(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> templateParams)
          Set Uri Template Variables
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Categories

public Categories(java.util.List<AtomCategory> categories)
Constructor

Parameters:
categories -

Categories

public Categories()
Constructor

Parameters:
categories -
Method Detail

getHref

public java.lang.String getHref()
When contained within an app:collection element, the app:categories element can have an href attribute whose value MUST point to an Atompub Categories Document.

Returns:
The href attribute value

setHref

public Categories setHref(java.lang.String href)
Sets the value of the href attribute.

Parameters:
href - The location of an Atompub Categories Document

setHref

public void setHref(java.lang.Class<?> handlingClass,
                    javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> templateParams)
Set Resource class that will generate Categories Document

Parameters:
handlingClass - Resource Class
templateParams - Map of URI variable names and their values

setHref

public void setHref(java.lang.Object handlingInstance,
                    javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> templateParams)
Set Resource that will generate Categories Document

Parameters:
handlingInstance - Resource instance
templateParams - Map of URI variable names and their values

isFixed

public boolean isFixed()
If an app:categories element is marked as fixed, then the set of atom:Category elements is considered to be a closed set. That is, Atom Publishing Protocol clients SHOULD only use the atom:Category elements listed. The default is false (fixed="no")

Returns:
True if the categories listing is fixed

setFixed

public Categories setFixed(boolean fixed)
Sets whether or not this is a fixed listing of categories. If set to false, the fixed attribute will be removed from the app:categories element.

Parameters:
fixed - True if the app:categories listing is fixed

getScheme

public java.lang.String getScheme()
The app:categories element may specify a default scheme attribute for listed atom:Category elements that do not have their own scheme attribute.

Returns:
The scheme String

setScheme

public Categories setScheme(java.lang.String scheme)
Sets the default scheme for this listing of categories

Parameters:
scheme - The default scheme used for this listing of categories

getCategories

public java.util.List<AtomCategory> getCategories()
Lists the complete set of categories

Returns:
This app:categories listing of atom:Category elements

getCategories

public java.util.List<AtomCategory> getCategories(java.lang.String scheme)
Lists the complete set of categories that use the specified scheme

Parameters:
scheme - The String of an atom:Category scheme
Returns:
A listing of atom:Category elements that use the specified scheme

addCategory

public Categories addCategory(AtomCategory category)
Add an atom:Category to the listing

Parameters:
Category - The atom:Category to add to the listing

addCategory

public AtomCategory addCategory(java.lang.String term)
Create and add an atom:Category to the listing

Parameters:
term - The string term
Returns:
The newly created atom:Category

addCategory

public AtomCategory addCategory(java.lang.String scheme,
                                java.lang.String term,
                                java.lang.String label)
Create an add an atom:Category to the listing

Parameters:
scheme - The scheme String for the newly created Category
term - The string term
label - The human readable label for the Category
Returns:
The newly created atom:Category

contains

public boolean contains(java.lang.String term)
Returns true if this app:categories listing contains a Category with the specified term

Parameters:
term - The term to look for
Returns:
True if the term is found

contains

public boolean contains(java.lang.String term,
                        java.lang.String scheme)
Returns true if this app:categories listing contains a Category with the specified term and scheme

Parameters:
term - The term to look for
scheme - The String scheme
Returns:
True if the term and scheme are found

isOutOfLine

public boolean isOutOfLine()
Returns true if the href attribute is set


getHandlingClass

public java.lang.Class<?> getHandlingClass()
Get Categories Document handling Resource class

Returns:
Resource class

setCategories

public void setCategories(java.util.List<AtomCategory> categories)
Set a list of categories

Parameters:
categories -

getHandlingInstance

public java.lang.Object getHandlingInstance()
Get handling Bean for Categories Document

Returns:
handlingBean

getTemplateParameters

public javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> getTemplateParameters()
Get Uri Template Variables

Returns:
templateParams

setTemplateParameters

public void setTemplateParameters(javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> templateParams)
Set Uri Template Variables

Parameters:
templateParams -


Copyright © 2009-2013 The Apache Software Foundation. All Rights Reserved.