Update of /cvsroot/jaxme/JaxMe2/docs
In directory sc8-pr-cvs1:/tmp/cvs-serv1050
Added Files:
Types.html
Log Message:
Initial version
--- NEW FILE: Types.html ---
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Mozilla/4.79 [en] (Win95; U) [Netscape]">
<title>JaxMe Types</title>
</head>
<body bgcolor="#FFFFFF">
<h1>JaxMe Types</h1>
The following types are available in JaxMe schemata:
<ul>
<li>XML Schema Standard Types
<li>ResourceBundle Formatted Types
<li>Types generated from SQL statements
<li>The AutoUpdate type
</ul>
<h2>XML Schema Standard Types</h2>
See the <a href="api/de/ispsoft/jaxme/generator/types/">JavaDocs</a>.
<br>
<h2>ResourceBundle Formatted Types</h2>
Types formatted by a ResourceBundle are actually wrappers for other types.
The backing type might be a dateTime, a number or a String. The wrapper
adds the ability of converting an element or attribute value to XML using
an instance of <tt>java.text.Format</tt>. In other words: You choose how
the value is formatted in the generated or parsed XML document.
<p>The instance can be specified explicitly, in which case it is generated
at compile time. It can also be specified implicitly using a ResourceBundle
key. The actual instance is then at run time by looking up the (possibly
localized) pattern in the ResourceBundle and instantiating the Formatter.
<p>Configuration examples:
<pre> <!-- Explicit format specificaton of a SimpleDateFormat
instance -->
<element name="staticDate" type="jm:rbFormatted">
<xs:annotation>
<xs:appinfo>
<jm:resourceBundeFormatted
base="xs:dateTime"
type="date" pattern="yyyy-MM-dd
HH:mm:ss"/>
</xs:appinfo>
</xs:annotation>
</element>
<!-- Implicit format specification of a DecimalFormat
instance -->
<element name="localizedDecimalNumber" type="jm:rbFormatted>
<xs:annotation>
<xs:appinfo>
<jm:rbFormatted base="xs:double"
type="decimal"
key="localized.decimal.number.pattern"/>
</xs:appinfo>
</xs:annotation>
</element>
</pre>
The <tt>jm:rbFormatted</tt> child of <tt>xs:appinfo</tt> supports the following
attributes:
<table BORDER >
<tr>
<th>Name</th>
<th>Description</th>
</tr>
<tr>
<td>base</td>
<td>Specifies the base type. Defaults to xs:string.</td>
</tr>
<tr>
<td>defaultPattern</td>
<td>Used in conjunction with the <tt>key</tt> attribute: If no Pattern
is found in the ResourceBundle, then the specified pattern is used to create
a Formatter.</td>
</tr>
<tr>
<td>formatClass</td>
<td>Specificies the subclass of <tt>java.text.Format</tt> being used. This
class must support a static method <tt>getInstance(String pattern)</tt>.
An alternative is using the <tt>type</tt> attribute, which provides shortcuts.
The <tt>formatClass</tt> and <tt>type</tt> attributes are mutually exclusive.</td>
</tr>
<tr>
<td>key</td>
<td>Specifying this attribute implies the generation of the Formatter at
run time. It is mutually exclusive with the attributes <tt>pattern</tt>
and <tt>newFormatter</tt>. To create a Formatter, the Marshallers or Unmarshallers
method <tt>getResourceBundle()</tt> will be invoked. If no ResourceBundle
is returned or if the key is not defined in the ResourceBundle, then a
SAXException is thrown. You may use the attribute <tt>defaultPattern</tt>
to prevent the exception..</td>
</tr>
<tr>
<td>newFormatter</td>
<td>If you want to specify a different way how a Formatter should be obtained,
then you may use this method. This attribute is mutually exclusive with
the attributes <tt>pattern</tt> and <tt>key</tt>.</td>
</tr>
<tr>
<td>pattern</td>
<td>Specifying this attribute implies the generation of the Formatter at
compile time, hence it is mutually exclusive with the attributes <tt>key</tt>
and <tt>newFormatter</tt>. The Formatter will typically be generated by
invoking <tt>formatClass.getInstance(pattern)</tt>.</td>
</tr>
<tr>
<td>type</td>
<td>Specificies the subclass of <tt>java.text.Format</tt> being used. Valid
values are:
<table>
<tr>
<th>date</th>
<td>java.text.SimpleDateFormat</td>
</tr>
<tr>
<th>decimal</th>
<td>java.text.DecimalFormat</td>
</tr>
<tr>
<th>message</th>
<td>java.text.MessageFormat</td>
</tr>
</table>
</td>
</tr>
</table>
<p>All attributes may also be as atomic child elements. This is particularly
useful in the case of the <tt>newFormatter</tt> attribute.
<p>For further details see
<ul>
<li>
The <a href="../examples/misc/resourceBundleFormatted.xsd">example schema</a>.</li>
<li>
The <a
href="api/de/ispsoft/jaxme/generator/types/ResourceBundleFormattedType.html">JavaDocs</a>.</li>
<li>
The <a href="api/de/ispsoft/jaxme/jaxb/junit/ResourceBundleTest.html">JUnit
sample</a>.</li>
</ul>
<a NAME="autosql"></a>
<h2>
Types generated from SQL statements</h2>
See the <a href="api/de/ispsoft/jaxme/generator/types/AutoSqlType.html">JavaDocs</a>.
<br><a NAME="autoupdate"></a>
<h2>
The AutoUpdateDateTime type</h2>
See the <a
href="api/de/ispsoft/jaxme/generator/types/AutoUpdateDateTime.html">JavaDocs</a></div>
</td>
</tr>
</table>
</body>
</html>
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Jaxme-jaxb-dev mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jaxme-jaxb-dev