|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.basex.build.fs.parser.ParserUtil
public final class ParserUtil
Utility methods for file parsers.
| Method Summary | |
|---|---|
static byte[] |
checkUTF(byte[] data)
Checks if the given byte array only contains valid UTF-8 characters. |
static javax.xml.datatype.XMLGregorianCalendar |
convertDate(java.util.Date date)
Converts a date value to an XMLGregorianCalendar instance. |
static javax.xml.datatype.Duration |
convertDuration(byte[] value)
Checks if the value is of the form mm:ss or if it is a
milliseconds value and returns a Duration instance. |
static javax.xml.datatype.Duration |
convertMinSecDuration(byte[] minSec)
Converts a duration value of the form mm:ss to an
Duration instance. |
static javax.xml.datatype.Duration |
convertMsDuration(int milliseconds)
Converts a duration value in milliseconds to an Duration instance. |
static void |
fireDateEvents(NewFSParser parser,
Metadata meta,
java.io.File file)
Writes the date values of the file to the parser. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static javax.xml.datatype.Duration convertMsDuration(int milliseconds)
Duration instance.
milliseconds - the number of milliseconds to convert.
Duration instance or null if the
conversion fails.public static javax.xml.datatype.Duration convertDuration(byte[] value)
mm:ss or if it is a
milliseconds value and returns a Duration instance.
value - the byte array to convert.
Duration instance or null if the
conversion fails.public static javax.xml.datatype.Duration convertMinSecDuration(byte[] minSec)
mm:ss to an
Duration instance.
minSec - the byte array containing the duration value.
Duration instance or null if the
conversion fails.public static javax.xml.datatype.XMLGregorianCalendar convertDate(java.util.Date date)
XMLGregorianCalendar instance.
date - the Date value to convert.
XMLGregorianCalendar instance or null if
the conversion fails.
public static void fireDateEvents(NewFSParser parser,
Metadata meta,
java.io.File file)
throws java.io.IOException
parser - the NewFSParser instance to fire
NewFSParser.metaEvent(Metadata) events.meta - the metadata item to use.file - the file to read time values from.
java.io.IOException - if any error occurs while writing to the parser.public static byte[] checkUTF(byte[] data)
data - the byte array to check.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||