|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.alien.enterpriseRFID.tags.TagUtil
TagUtils provides utility methods for parsing XML- and text-based taglists from the reader into Tags and arrays of Tags.
Constructor Summary | |
TagUtil()
Constructor is not required, since all fields and methods are declared static. |
Method Summary | |
static Tag |
decodeCustomTag(java.lang.String tagLine)
|
static Tag[] |
decodeCustomTagList(java.lang.String tagLines)
|
static Tag[] |
decodeCustomTagList(java.lang.String tagLines,
java.lang.String customFormatString)
Decodes a custom-formatted tag list message from a reader into an array of Tags. |
static Tag |
decodeTag(java.lang.String tagLine)
Decode a single text-based line of tag list data into a single Tag item. |
static Tag[] |
decodeTagList(java.lang.String tagLines)
Decodes a text-based tag list message from a reader into an array of Tags. |
static Tag |
decodeXMLTag(java.lang.String xmlData)
Decode an individual tag's information from an XML-based tag message. |
static Tag[] |
decodeXMLTagList(java.lang.String xmlData)
Decodes an XML-based tag list message from a reader into an array of Tags. |
static java.lang.String |
getCustomFormatString()
|
static java.util.Date |
parseDate(java.lang.String dateString)
Converts a date string from a reader into a Date object. |
static java.util.Date |
parseDateAndTime(java.lang.String dateString)
Converts a date+time string from a reader into a Date object. |
static java.util.Date |
parseTime(java.lang.String timeString)
Converts a time string from a reader into a Date object. |
static void |
setCustomFormatString(java.lang.String customFormatString)
|
static java.lang.String |
taglistAsString(Tag[] taglist)
Returns a string representation of an entire taglist, Tag[]. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TagUtil()
Method Detail |
public static void setCustomFormatString(java.lang.String customFormatString)
public static java.lang.String getCustomFormatString()
public static Tag[] decodeXMLTagList(java.lang.String xmlData)
<Alien-RFID-Tag-List> <Alien-RFID-Tag> <TagID>0203 0405 0607 0809</TagID> <DiscoveryTime>2003/12/09 16:16:16</DiscoveryTime> <LastSeenTime>2003/12/09 16:16:57</LastSeenTime> <Antenna>0</Antenna> <ReadCount>48</ReadCount> <Protocol>1</Protocol> (optional) </Alien-RFID-Tag> <Alien-RFID-Tag> <TagID>8000 8004 0000 003B</TagID> <DiscoveryTime>2003/12/09 16:16:16</DiscoveryTime> <LastSeenTime>2003/12/09 16:16:58</LastSeenTime> <Antenna>0</Antenna> <ReadCount>222</ReadCount> <Protocol>1</Protocol> (optional) </Alien-RFID-Tag> </Alien-RFID-Tag-List>
xmlData
- the XML string to be parsed and decoded
public static Tag decodeXMLTag(java.lang.String xmlData)
<Alien-RFID-Tag> <TagID>0203 0405 0607 0809</TagID> <DiscoveryTime>2003/12/09 16:16:16</DiscoveryTime> <LastSeenTime>2003/12/09 16:16:57</LastSeenTime> <Antenna>0</Antenna> <ReadCount>48</ReadCount> <Protocol>1</Protocol> (optional) </Alien-RFID-Tag>
xmlData
- the XML string containing the Tag information to be parsed
public static Tag[] decodeTagList(java.lang.String tagLines)
tagLines
- the multi-line String containing text-based taglist data
public static Tag decodeTag(java.lang.String tagLine)
The only mandatory field is the TagID - other fields are optional.
tagLine
- the line of text-based tag data to be parsed
public static Tag[] decodeCustomTagList(java.lang.String tagLines, java.lang.String customFormatString)
This method uses the supplied customFormatString as a template for parsing the tagLines.
tagLines
- the multi-line String containing custom-formatted taglist data
public static Tag[] decodeCustomTagList(java.lang.String tagLines)
public static Tag decodeCustomTag(java.lang.String tagLine)
public static java.util.Date parseDateAndTime(java.lang.String dateString)
dateString
- the date+time string to be parsed
public static java.util.Date parseDate(java.lang.String dateString)
dateString
- the date string to be parsed
public static java.util.Date parseTime(java.lang.String timeString)
timeString
- the time string to be parsed
public static java.lang.String taglistAsString(Tag[] taglist)
taglist
- the array of Tags to dump
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |