Overview | Package | Class | Tree | Serialized | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.muse.util.xml
Class XsdUtils

    java.lang.Object
      org.apache.muse.util.xml.XsdUtils

public class XsdUtils
extends java.lang.Object

XsdUtils is a collection of utility methods related to XML Schema.

Author:
  Dan Jemiolo (danj)

Field Summary
`static QName` | `ANY_TYPE_QNAME`
`static QName` | `ANY_URI_QNAME`
`static QName` | `ATTRIBUTE_GROUP_QNAME`
`static QName` | `ATTRIBUTE_QNAME`
`static java.lang.String` | `BASE`
`static QName` | `BOOLEAN_QNAME`
`static QName` | `COMPLEX_CONTENT_QNAME`
`static QName` | `COMPLEX_TYPE_QNAME`
`static QName` | `DATE_QNAME`
`static QName` | `DATE_TIME_QNAME`
`static QName` | `DOUBLE_QNAME`
`static QName` | `DURATION_QNAME`
`static QName` | `ELEMENT_QNAME`
`static QName` | `EXTENSION_QNAME`
`static QName` | `FLOAT_QNAME`
`static QName` | `IMPORT_QNAME`
`static QName` | `INCLUDE_QNAME`
`static QName` | `INT_QNAME`
`static QName` | `INTEGER_QNAME`
`static QName` | `LONG_QNAME`
`static java.lang.String` | `MAX_OCCURS`
`static java.lang.String` | `MIN_OCCURS`
`static long` | `MS_IN_A_DAY`
`static long` | `MS_IN_A_HOUR`
`static long` | `MS_IN_A_MINUTE`
`static long` | `MS_IN_A_MONTH`
`static long` | `MS_IN_A_YEAR`
`static java.lang.String` | `NAME`
`static java.lang.String` | `NAMESPACE`
`static java.lang.String` | `NAMESPACE_URI` The XML Schema namespace URI.
`static QName` | `NC_NAME_QNAME`
`static QName` | `NIL_QNAME`
`static java.lang.String` | `NILLABLE`
`static java.lang.String` | `PREFIX`
`static QName` | `QNAME_QNAME`
`static java.lang.String` | `REF`
`static java.lang.String` | `SCHEMA_LOCATION`
`static QName` | `SCHEMA_QNAME`
`static QName` | `SEQUENCE_QNAME`
`static QName` | `SHORT_QNAME`
`static QName` | `SIMPLE_TYPE_QNAME`
`static QName` | `STRING_QNAME`
`static java.lang.String` | `TYPE`
`static java.lang.String` | `UNBOUNDED`

Constructor Summary
`XsdUtils()`

Method Summary
`static java.lang.String` | `getDuration(java.util.Date before, java.util.Date after)`
`static java.lang.String` | `getDuration(long totalTime)`
`static long` | `getDuration(java.lang.String durationString)` Parses an xsd:duration string into its time value (in millseconds).
`static java.util.Date` | `getLocalTime(java.lang.String dateTimeString)` Parses the given XSD date string into a Date object.
`static java.lang.String` | `getLocalTimeString()` This is a convenience method that returns the text version of the current time, in standard XSD format.
`static java.lang.String` | `getLocalTimeString(java.util.Date date)` Returns the text version of the given date, in standard XSD format.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### NAMESPACE_URI

    public static final java.lang.String NAMESPACE_URI

  The XML Schema namespace URI.

  See Also:
    Constant Field Values

### PREFIX

    public static final java.lang.String PREFIX

See Also:
  Constant Field Values

### ANY_TYPE_QNAME

    public static final QName ANY_TYPE_QNAME

### ANY_URI_QNAME

    public static final QName ANY_URI_QNAME

### ATTRIBUTE_GROUP_QNAME

    public static final QName ATTRIBUTE_GROUP_QNAME

### ATTRIBUTE_QNAME

    public static final QName ATTRIBUTE_QNAME

### BOOLEAN_QNAME

    public static final QName BOOLEAN_QNAME

### COMPLEX_TYPE_QNAME

    public static final QName COMPLEX_TYPE_QNAME

### COMPLEX_CONTENT_QNAME

    public static final QName COMPLEX_CONTENT_QNAME

### EXTENSION_QNAME

    public static final QName EXTENSION_QNAME

### DATE_QNAME

    public static final QName DATE_QNAME

### DATE_TIME_QNAME

    public static final QName DATE_TIME_QNAME

### DOUBLE_QNAME

    public static final QName DOUBLE_QNAME

### DURATION_QNAME

    public static final QName DURATION_QNAME

### ELEMENT_QNAME

    public static final QName ELEMENT_QNAME

### FLOAT_QNAME

    public static final QName FLOAT_QNAME

### IMPORT_QNAME

    public static final QName IMPORT_QNAME

### INCLUDE_QNAME

    public static final QName INCLUDE_QNAME

### INT_QNAME

    public static final QName INT_QNAME

### INTEGER_QNAME

    public static final QName INTEGER_QNAME

### LONG_QNAME

    public static final QName LONG_QNAME

### MAX_OCCURS

    public static final java.lang.String MAX_OCCURS

See Also:
  Constant Field Values

### MIN_OCCURS

    public static final java.lang.String MIN_OCCURS

See Also:
  Constant Field Values

### MS_IN_A_DAY

    public static final long MS_IN_A_DAY

See Also:
  Constant Field Values

### MS_IN_A_HOUR

    public static final long MS_IN_A_HOUR

See Also:
  Constant Field Values

### MS_IN_A_MINUTE

    public static final long MS_IN_A_MINUTE

See Also:
  Constant Field Values

### MS_IN_A_MONTH

    public static final long MS_IN_A_MONTH

See Also:
  Constant Field Values

### MS_IN_A_YEAR

    public static final long MS_IN_A_YEAR

See Also:
  Constant Field Values

### NAME

    public static final java.lang.String NAME

See Also:
  Constant Field Values

### NAMESPACE

    public static final java.lang.String NAMESPACE

See Also:
  Constant Field Values

### NC_NAME_QNAME

    public static final QName NC_NAME_QNAME

### NIL_QNAME

    public static final QName NIL_QNAME

### NILLABLE

    public static final java.lang.String NILLABLE

See Also:
  Constant Field Values

### QNAME_QNAME

    public static final QName QNAME_QNAME

### REF

    public static final java.lang.String REF

See Also:
  Constant Field Values

### BASE

    public static final java.lang.String BASE

See Also:
  Constant Field Values

### SCHEMA_LOCATION

    public static final java.lang.String SCHEMA_LOCATION

See Also:
  Constant Field Values

### SCHEMA_QNAME

    public static final QName SCHEMA_QNAME

### SEQUENCE_QNAME

    public static final QName SEQUENCE_QNAME

### SHORT_QNAME

    public static final QName SHORT_QNAME

### SIMPLE_TYPE_QNAME

    public static final QName SIMPLE_TYPE_QNAME

### STRING_QNAME

    public static final QName STRING_QNAME

### TYPE

    public static final java.lang.String TYPE

See Also:
  Constant Field Values

### UNBOUNDED

    public static final java.lang.String UNBOUNDED

See Also:
  Constant Field Values

Constructor Detail

### XsdUtils

    public XsdUtils()

Method Detail

### getDuration

    public static java.lang.String getDuration(java.util.Date before,
                                               java.util.Date after)

  Parameters:
    `before` -
    `after` -
  Returns:
    A valid xsd:duration value that represents the time between the two dates. If the second time is before the first one, the duration will have a '-' prefix, meaning it is negative.

### getDuration

    public static java.lang.String getDuration(long totalTime)

  Parameters:
    `totalTime` -
  Returns:
    A valid xsd:duration value that represents the given time. If the value is negative, the duration will have a '-' prefix, meaning it is negative.

### getDuration

    public static long getDuration(java.lang.String durationString)

  Parses an xsd:duration string into its time value (in millseconds). The format of a xsd:duration is:
  (-)PaYbMcD(TxHyMzS)
  Where a, b, and c are the years, months, and days, respectively. The time value (following the 'T') is optional. Its values - x, y, and z - are the hours, minutes, and seconds, respectively. The value of the duration may be negative.

  Parameters:
    `durationString` - A valid xsd:duration string.
  Returns:
    The time, in milliseconds, represented by the given xsd:duration.

### getLocalTime

    public static java.util.Date getLocalTime(java.lang.String dateTimeString)
                                       throws java.text.ParseException

  Parses the given XSD date string into a Date object.

  Parameters:
    `dateTimeString` - The text description of a date, in standard XSD format.
  Returns:
    The Date equivalent of the date string.
  Throws:
    `java.text.ParseException` -
    - If the format of the date string was incorrect.

### getLocalTimeString

    public static java.lang.String getLocalTimeString()

  This is a convenience method that returns the text version of the current time, in standard XSD format.

  See Also:
    `getLocalTimeString(Date)`

### getLocalTimeString

    public static java.lang.String getLocalTimeString(java.util.Date date)

  Returns the text version of the given date, in standard XSD format. It will include a +/- suffix that adds or subtracts hours from the UTC time in order to express local time.

  Parameters:
    `date` - The date to serialize into text.
  Returns:
    A string that describes the given date, in XSD format, with a +/- suffix to denote the local time.

Overview | Package | Class | Tree | Serialized | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD