|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.clapper.curn.parser.ParserUtil
public final class ParserUtil
Common utility routines that can be used by all parser implementations.
| Field Summary | |
|---|---|
static java.lang.String |
RSS_MIME_TYPE
Default MIME type for RSS feeds, if we can't figure one out. |
| Method Summary | |
|---|---|
static RSSLink |
findMatchingLink(java.util.Collection<RSSLink> links,
RSSLink.Type linkType)
Find the first RSSLink object with a specific link type. |
static RSSLink |
findMatchingLink(java.util.Collection<RSSLink> links,
java.lang.String mimeType)
Find the first RSSLink object with a specific MIME type. |
static RSSLink |
findMatchingLink(java.util.Collection<RSSLink> links,
java.lang.String mimeType,
RSSLink.Type... linkTypes)
Find the RSSLink object with a specific MIME type and one of
a set of link types. |
static java.lang.String |
getLinkMIMEType(java.net.URL url)
Get the MIME type for a link from an RSS feed. |
static java.lang.String |
normalizeCharacterData(char[] ch,
int start,
int length)
Used to process the characters found between two XML elements, this method removes any leading and trailing white space, including newlines. |
static void |
normalizeCharacterData(char[] ch,
int start,
int length,
java.lang.StringBuffer buf)
Used to process the characters found between two XML elements, this method removes any leading and trailing white space, including newlines. |
static java.lang.String |
normalizeCharacterData(java.lang.String s)
Used to process the characters found between two XML elements, this method removes any leading and trailing white space, including newlines. |
static java.util.Date |
parseDate(java.lang.String sDate)
Try to parse a date using as many methods as possible, until one works. |
static java.util.Date |
parseRFC822Date(java.lang.String sDate)
Parse an RFC 822-style date string. |
static java.util.Date |
parseW3CDate(java.lang.String sDate)
Parse a W3C date string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String RSS_MIME_TYPE
| Method Detail |
|---|
public static java.util.Date parseDate(java.lang.String sDate)
sDate - the date string
public static java.util.Date parseRFC822Date(java.lang.String sDate)
sDate - the date string
public static java.util.Date parseW3CDate(java.lang.String sDate)
sDate - the date string
public static java.lang.String normalizeCharacterData(char[] ch,
int start,
int length)
ch - the array of characters to processstart - the start position in the arraylength - the number of characters to read from the array
normalizeCharacterData(char[],int,int,StringBuffer),
normalizeCharacterData(String)public static java.lang.String normalizeCharacterData(java.lang.String s)
s - the string to process
normalizeCharacterData(char[],int,int,StringBuffer),
normalizeCharacterData(String)
public static void normalizeCharacterData(char[] ch,
int start,
int length,
java.lang.StringBuffer buf)
ch - the array of characters to processstart - the start position in the arraylength - the number of characters to read from the arraybuf - where to append the resulting charactersnormalizeCharacterData(char[],int,int),
normalizeCharacterData(String)
public static RSSLink findMatchingLink(java.util.Collection<RSSLink> links,
java.lang.String mimeType,
RSSLink.Type... linkTypes)
RSSLink object with a specific MIME type and one of
a set of link types.
links - collection of RSSLink objects to searchmimeType - the desired MIME typelinkTypes - one or more link types that are acceptable
public static RSSLink findMatchingLink(java.util.Collection<RSSLink> links,
RSSLink.Type linkType)
RSSLink object with a specific link type.
links - collection of RSSLink objects to searchlinkType - the desired link type
public static RSSLink findMatchingLink(java.util.Collection<RSSLink> links,
java.lang.String mimeType)
RSSLink object with a specific MIME type.
links - collection of RSSLink objects to searchmimeType - the desired MIME type
public static java.lang.String getLinkMIMEType(java.net.URL url)
url - The URL
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||