de.ispsoft.jaxme.jaxb
Class JMManagerFactoryAttachable

java.lang.Object
  extended byde.ispsoft.jaxme.jaxb.JMManagerFactoryAttachable
Direct Known Subclasses:
MarshallerImpl, UnmarshallerImpl, ValidatorImpl

public abstract class JMManagerFactoryAttachable
extends java.lang.Object

A common base class for MarshallerImpl, UnmarshallerImpl and ValidatorImpl.

Version:
$Id: JMManagerFactoryAttachable.java,v 1.8 2003/01/10 02:39:00 joe Exp $
Author:
Jochen Wiedmann

Field Summary
static java.lang.String BUILTIN_DATE_FORMAT
          Builtin default for formatting dates: yyyy-MM-dd
static java.lang.String BUILTIN_DATETIME_FORMAT
          Builtin default for formatting dateTimes: yyyy-MM-dd HH:mm:ss
static java.lang.String BUILTIN_ENCODING
          Builtin default encoding.
static java.lang.String BUILTIN_TIME_FORMAT
          Builtin default for formatting times: HH:mm:ss
 
Constructor Summary
JMManagerFactoryAttachable()
          Constructor for JMManagerFactoryAttachable.
 
Method Summary
 java.text.DateFormat getDateFormat()
          Returns the default for parsing or formatting dates.
 java.text.DateFormat getDateFormat(java.lang.String pKey)
          Returns an instance of DateFormat for formatting an instance of java.sql.Date.
 java.text.DateFormat getDateFormatForPattern(java.lang.String pPattern)
          Returns an instance of DateFormat with the given format pattern.
 java.text.DateFormat getDateTimeFormat()
          Returns the default for parsing or formatting datetime values.
 java.text.DateFormat getDateTimeFormat(java.lang.String pKey)
          Returns an instance of DateFormat for formatting an instance of java.util.Date.
 java.lang.String getEncoding()
          Returns this Marshallers encoding.
 JMManagerFactory getFactory()
          Returns the factory that created this instance.
 java.util.Locale getLocale()
          Returns the Locale.
 java.text.MessageFormat getMessageFormat(java.lang.String pPattern)
          Returns an instance of MessageFormat with the given format pattern.
 java.text.NumberFormat getNumberFormat(java.lang.String pPattern)
          Returns an instance of NumberFormat with the given format pattern.
protected  java.lang.Object getPrivateProperty(java.lang.String pName)
          Fetches the given property from an internal map.
 java.lang.Object getProperty(java.lang.String pName)
          Returns the value of the given property.
 java.util.ResourceBundle getResourceBundle()
          Returns the Marshallers ResourceBundle.
protected  java.lang.String getResourceValue(java.lang.String pKey, java.lang.String pDefault)
          Looks in the ResourceBundle for the key pKey.
 java.text.DateFormat getTimeFormat()
          Returns the default for formatting or parsing time values.
 java.text.DateFormat getTimeFormat(java.lang.String pKey)
          Returns an instance of DateFormat for formatting an instance of java.sql.Time.
 void setDateFormat(java.text.DateFormat pFormat)
          Sets the default for parsing or formatting dates.
 void setDateTimeFormat(java.text.DateFormat pFormat)
          Sets the default for parsing or formatting datetime values.
 void setEncoding(java.lang.String pEncoding)
          Sets this Marshallers encoding.
 void setFactory(JMManagerFactory pFactory)
          Sets the factory that created this instance.
 void setLocale(java.util.Locale pLocale)
          Sets the Locale.
protected  void setPrivateProperty(java.lang.String pName, java.lang.Object pValue)
          Stores the given property in an internal map.
 void setProperty(java.lang.String pName, java.lang.Object pValue)
          Sets the value of the given property.
 void setResourceBundle(java.util.ResourceBundle pBundle)
          Sets the Marshallers ResourceBundle.
 void setTimeFormat(java.text.DateFormat pFormat)
          Sets the default for formatting or parsing time values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUILTIN_ENCODING

public static final java.lang.String BUILTIN_ENCODING

Builtin default encoding.

See Also:
setEncoding(java.lang.String), Constant Field Values

BUILTIN_DATE_FORMAT

public static final java.lang.String BUILTIN_DATE_FORMAT

Builtin default for formatting dates: yyyy-MM-dd

See Also:
setDateFormat(java.text.DateFormat), BUILTIN_DATETIME_FORMAT, BUILTIN_TIME_FORMAT, SimpleDateFormat, Constant Field Values

BUILTIN_DATETIME_FORMAT

public static final java.lang.String BUILTIN_DATETIME_FORMAT

Builtin default for formatting dateTimes: yyyy-MM-dd HH:mm:ss

See Also:
setDateTimeFormat(java.text.DateFormat), BUILTIN_DATE_FORMAT, BUILTIN_TIME_FORMAT, SimpleDateFormat, Constant Field Values

BUILTIN_TIME_FORMAT

public static final java.lang.String BUILTIN_TIME_FORMAT

Builtin default for formatting times: HH:mm:ss

See Also:
setTimeFormat(java.text.DateFormat), BUILTIN_DATETIME_FORMAT, BUILTIN_TIME_FORMAT, SimpleDateFormat, Constant Field Values
Constructor Detail

JMManagerFactoryAttachable

public JMManagerFactoryAttachable()
Constructor for JMManagerFactoryAttachable.

Method Detail

setLocale

public void setLocale(java.util.Locale pLocale)

Sets the Locale.


getLocale

public java.util.Locale getLocale()

Returns the Locale.


getResourceValue

protected java.lang.String getResourceValue(java.lang.String pKey,
                                            java.lang.String pDefault)

Looks in the ResourceBundle for the key pKey. If the key is found, returns the keys value. Otherwise returns the given default pDefault.


setFactory

public void setFactory(JMManagerFactory pFactory)

Sets the factory that created this instance.


getFactory

public JMManagerFactory getFactory()

Returns the factory that created this instance.


setEncoding

public void setEncoding(java.lang.String pEncoding)

Sets this Marshallers encoding. Can also be set with setProperty("jaxb.encoding", pEncoding).

See Also:
BUILTIN_ENCODING, getEncoding(), setResourceBundle(java.util.ResourceBundle)

getEncoding

public java.lang.String getEncoding()

Returns this Marshallers encoding. Can also be fetched with getProperty("jaxb.encoding").

See Also:
BUILTIN_ENCODING, setEncoding(java.lang.String), getResourceBundle()

setResourceBundle

public void setResourceBundle(java.util.ResourceBundle pBundle)

Sets the Marshallers ResourceBundle. Can also be set with setProperty("jaxme.resourcebundle", pBundle).

See Also:
getResourceBundle()

getResourceBundle

public java.util.ResourceBundle getResourceBundle()

Returns the Marshallers ResourceBundle. Can also be fetched with getProperty("jaxme.resourcebundle").

See Also:
setResourceBundle(java.util.ResourceBundle)

setDateFormat

public void setDateFormat(java.text.DateFormat pFormat)

Sets the default for parsing or formatting dates. Defaults to BUILTIN_DATE_FORMAT. Can also be set with setProperty("jaxme.format.date", pFormat).

See Also:
BUILTIN_DATE_FORMAT, getDateFormat(), setResourceBundle(java.util.ResourceBundle)

getDateFormat

public java.text.DateFormat getDateFormat()

Returns the default for parsing or formatting dates. Defaults to BUILTIN_DATE_FORMAT. Can also be fetched with getProperty("jaxme.format.date").

See Also:
BUILTIN_DATE_FORMAT, setDateFormat(java.text.DateFormat), getResourceBundle()

setDateTimeFormat

public void setDateTimeFormat(java.text.DateFormat pFormat)

Sets the default for parsing or formatting datetime values. Defaults to BUILTIN_DATETIME_FORMAT. Can also be set with setProperty("jaxme.format.datetime", pFormat).

See Also:
BUILTIN_DATETIME_FORMAT, getDateTimeFormat(), setResourceBundle(java.util.ResourceBundle)

getDateTimeFormat

public java.text.DateFormat getDateTimeFormat()

Returns the default for parsing or formatting datetime values. Defaults to BUILTIN_DATETIME_FORMAT. Can also be fetched with getProperty("jaxme.format.datetime").

See Also:
BUILTIN_DATETIME_FORMAT, setDateTimeFormat(java.text.DateFormat), getResourceBundle()

setTimeFormat

public void setTimeFormat(java.text.DateFormat pFormat)

Sets the default for formatting or parsing time values. Defaults to BUILTIN_TIME_FORMAT. Can also be set with setProperty("jaxme.format.time", pFormat).

See Also:
BUILTIN_TIME_FORMAT, getTimeFormat(), setResourceBundle(java.util.ResourceBundle)

getTimeFormat

public java.text.DateFormat getTimeFormat()

Returns the default for formatting or parsing time values. Defaults to BUILTIN_TIME_FORMAT. Can also be set with getProperty("jaxme.format.time").

See Also:
BUILTIN_TIME_FORMAT, getTimeFormat(), getResourceBundle()

setPrivateProperty

protected void setPrivateProperty(java.lang.String pName,
                                  java.lang.Object pValue)

Stores the given property in an internal map. May be used for all properties that don't offer a bean property. This applies in particular to "jaxme.locale" and "jaxme.private.*". Equivalent to

   setProperty(pName, pValue);
 

See Also:
getPrivateProperty(java.lang.String)

getPrivateProperty

protected java.lang.Object getPrivateProperty(java.lang.String pName)

Fetches the given property from an internal map. May be used for all properties that don't offer a bean property. This applies in particular to "jaxme.locale" and "jaxme.private.*". Equivalent to

   getProperty(pName);
 

Returns:
Null, if the property wasn't set or had a null value. There is no possibility to distinguish these two cases.
See Also:
getPrivateProperty(java.lang.String)

getProperty

public java.lang.Object getProperty(java.lang.String pName)
                             throws JAXBException,
                                    UnrecognizedPropertyException,
                                    UnsupportedPropertyException

Returns the value of the given property.

Throws:
JAXBException
UnrecognizedPropertyException
UnsupportedPropertyException

setProperty

public void setProperty(java.lang.String pName,
                        java.lang.Object pValue)
                 throws JAXBException,
                        UnrecognizedPropertyException,
                        UnsupportedPropertyException

Sets the value of the given property.

Throws:
JAXBException
UnrecognizedPropertyException
UnsupportedPropertyException

getDateFormatForPattern

public java.text.DateFormat getDateFormatForPattern(java.lang.String pPattern)

Returns an instance of DateFormat with the given format pattern.


getTimeFormat

public java.text.DateFormat getTimeFormat(java.lang.String pKey)

Returns an instance of DateFormat for formatting an instance of java.sql.Time. If pKey is non-null, then it is taken as the argument for a pattern lookup in the ResourceBundle.


getDateFormat

public java.text.DateFormat getDateFormat(java.lang.String pKey)

Returns an instance of DateFormat for formatting an instance of java.sql.Date. If pKey is non-null, then it is taken as the argument for a pattern lookup in the ResourceBundle.


getDateTimeFormat

public java.text.DateFormat getDateTimeFormat(java.lang.String pKey)

Returns an instance of DateFormat for formatting an instance of java.util.Date. If pKey is non-null, then it is taken as the argument for a pattern lookup in the ResourceBundle.


getNumberFormat

public java.text.NumberFormat getNumberFormat(java.lang.String pPattern)

Returns an instance of NumberFormat with the given format pattern.


getMessageFormat

public java.text.MessageFormat getMessageFormat(java.lang.String pPattern)

Returns an instance of MessageFormat with the given format pattern.