Package com.day.cq.commons.feed
Class AbstractFeed
java.lang.Object
com.day.cq.commons.feed.AbstractFeed
- All Implemented Interfaces:
Feed
The
AbstractFeed serves as a base for classes printing
resources as feeds.-
Field Summary
Fields inherited from interface com.day.cq.commons.feed.Feed
DEFAULT_CHARACTER_ENCODING, DEFAULT_CONTENT_TYPE, SELECTOR_ATOM, SELECTOR_FEED, SELECTOR_FEEDENTRY, SELECTOR_RSS, SUFFIX_COMMENTS, SUFFIX_FEED, SUFFIX_FEEDENTRY, SUFFIX_HTML, SUFFIX_XML -
Constructor Summary
ConstructorsConstructorDescriptionAbstractFeed(Resource res, SlingHttpServletRequest req, SlingHttpServletResponse resp) Creates a new feed instance using the specified resource. -
Method Summary
Modifier and TypeMethodDescriptionReturns the character encoding of the feed.Returns the content type of the feed.voidPrints the children of the current resource as feed entriesvoidprintChildEntries(int max) Prints the children of the current resource as feed entriesvoidprintEntries(Iterator<Resource> iter) Prints the specified resources as feed entriesvoidprintEntries(Iterator<Resource> iter, int max) Prints the specified resources as feed entriesvoidprintEntry(Resource res) Prints the specified resource as a feed entryvoidWrites the feed footer.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.day.cq.commons.feed.Feed
printEntry, printHeader
-
Constructor Details
-
AbstractFeed
public AbstractFeed(Resource res, SlingHttpServletRequest req, SlingHttpServletResponse resp) throws RepositoryException Creates a new feed instance using the specified resource.- Parameters:
res- The resourcereq- The servlet requestresp- The servlet response- Throws:
RepositoryException- if no node can be found
-
-
Method Details
-
getContentType
Returns the content type of the feed.- Specified by:
getContentTypein interfaceFeed- Returns:
- The type
-
getCharacterEncoding
Returns the character encoding of the feed.- Specified by:
getCharacterEncodingin interfaceFeed- Returns:
- The encoding
-
printEntry
Prints the specified resource as a feed entry- Specified by:
printEntryin interfaceFeed- Parameters:
res- the resource- Throws:
IOException- If output fails
-
printChildEntries
Prints the children of the current resource as feed entries- Specified by:
printChildEntriesin interfaceFeed- Throws:
IOException- If output fails
-
printChildEntries
Prints the children of the current resource as feed entries- Specified by:
printChildEntriesin interfaceFeed- Parameters:
max- The maximum number of entries- Throws:
IOException- If output fails
-
printEntries
Prints the specified resources as feed entries- Specified by:
printEntriesin interfaceFeed- Parameters:
iter- The resources- Throws:
IOException- If output fails
-
printEntries
Prints the specified resources as feed entries- Specified by:
printEntriesin interfaceFeed- Parameters:
iter- The resourcesmax- The maximum number of entries- Throws:
IOException- If output fails
-