Cobery, Marc (Marc) wrote:
I would be happy to help but where do I start?
For a start, by providing review. As it turns out, I'll need something
like "jm:interface" really soon. If you are interested, help me in the
docs and take up the work as soon as I'm done with that by adding
"jm:extends" and "jm:javasource".
Below you'll find a piece of documentation. Please review. Additionally,
it definitely needs improvement. You'd help me a real lot by taking up
that part initially.
Jochen
<?xml version="1.0" encoding="US-ASCII"?>
<!--
Copyright 2004 The Apache Software Foundation.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<chapter><title>Customization</title>
<para>JaxMe provides certain customizations: You do not need
to accept the generated sources as they are.
</para>
<sect1><title>JAXB customizations</title>
<para>A lot of customizations are already part of the JAXB
specifications.
Using these customizations is highly recommended, because the
result is still portable among JAXB implementations. These should
definitely be documented here. However, they aren't, for lack of
time.
As a start, we recommend to read the relevant section in the
<ulink
url="http://java.sun.com/webservices/docs/1.5/tutorial/doc/JAXBUsing4.html">
JAXB RI tutorial</ulink>.</para>
</sect1>
<sect1><title>JAXB RI vendor customizations</title>
<para>The JAXB reference implementation extends the specification with
so-called vendor customizations. These aren't covered by the
specifications
and therefore not portable amongst arbitrary JAXB
implementations. However,
they are portable at least between the JAXB RI and JaxMe (if the
latter
implements them).</para>
<para>Like the JAXB customizations, these are still undocumented here.
Please, read the relevant section in the
<ulink
url="http://java.sun.com/webservices/docs/1.6/jaxb/vendorCustomizations.html">
JAXB RI documentation</ulink>.</para>
</sect1>
<sect1><title>JaxMe vendor customizations</title>
<para>These customizations are proprietary for JaxMe. Whenever
possible, do not use them. If you do use them, you are loosing
portability to any other JAXB implementation. However, you'll
note, that they are very powerful, so loosing portability might
be the better option in the end.</para>
<sect2><title>Extending other interfaces or classes</title>
<para>It is quite common, that one wants the generated classes
to extend or implement an interface or another class.
This is possible using the <token>jaxme:implements</token>, or
<token>jaxme:extends</token> tags.</para>
<para>Before using these tags, you have to understand what is
being configured. JaxMe distinguishes between the following
class types:
<variablelist><title>Customizable JaxMe class types</title>
<varlistentry><term>elementInterface</term>
<listitem>The element interface is the interface derived
from an element. For example, in the section
on first steps, the interface <token>Address</token>.
is an element interface. By default, the element
interfaces are extending the interface
<token>javax.xml.bind.Element</token> and their
respective type interface.</listitem>
</varlistentry>
<varlistentry><term>typeInterface</term>
<listitem>The type interface is the interface derived
from a complex type. For example, in the section
on first steps, the interface <token>AddressType</token>.
is a type interface. By default, the type
interfaces do not extend any particular interfaces.</listitem>
</varlistentry>
<varlistentry><term>elementImplementation</term>
<listitem>The element implementation is the actual
bean class, which is derived from an element. For example,
in the section on first steps, the class
<token>AddressImpl</token> is an element implementation.
By default, the element implementation is implementing
the element interface and extending the type implementation.
</listitem>
</varlistentry>
<varlistentry><term>typeImplementation</term>
<listitem>The type implementation is the actual bean class,
which is derived from a type. For example, in the section
on first steps, the class <token>AddressTypeImpl</token>
is a type implementation. By default, type implementations
are neither implementing or extending a particular class.
</listitem>
</varlistentry>
<varlistentry><term>typeDriver</term>
<listitem>The type driver is the class being used by the
<token>Marshaller</token> for serializing the
generated bean classes. For example, the
<token>AddressType</token> has an associated type driver
<token>AddressTypeDriver</token>. Type drivers are by
default implementing the interface <token>JMSAXDriver</token>.
</listitem>
</varlistentry>
<varlistentry><term>typeHandler</term>
<listitem>The type handler is the class being used by the
<token>Unmarshaller</token> for unmarshalling the
generated bean classes. For example, the
<token>AddressType</token> has an associated type handler
<token>AddressTypeHandler</token>. Type handlers are by
default extending the class
<token>JMSAXElementHandler</token>.
</listitem>
</varlistentry>
</variablelist>
</para>
<para>If you want to specify, that the generated type implementations
should implement the interface <token>java.io.Serializable</token>,
then you could do it like this:
<programlisting>
<jaxme:implements type="typeImplementation"
className="java.io.Serializable"
xmlns:jaxme="http://ws.apache.org/jaxme/namespaces/jaxme2"/>
</programlisting>
You can put this into the globalBindings (in which case it applies
to
all generated type implementations), into the schemaBindings (in
which
case it applies to all type implementations of the current schema),
or
into a single type, in which case it applies to the current type
only.
</para>
<para>If you want to specify more than one interface, which is being
extended, use multiple <token>jaxme:implements</token>
elements.</para>
<para>If you want to extend other classes, the syntax looks like this:
<programlisting>
<jaxme:extends type="typeImplementation"
className="org.apache.ws.jaxme.pm.ino.InoObjectImpl"/>
</programlisting></para>
</sect2>
</sect1>
</chapter>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]