Commit 0ab2bc27 authored by Lukas Jungmann's avatar Lukas Jungmann
Browse files

update spec, chapter 6

Signed-off-by: default avatarLukas Jungmann <lukas.jungmann@oracle.com>
parent d8eca6df
......@@ -24,40 +24,6 @@ include::appI-changelog.adoc[]
'''''
[.footnoteNumber]# 21.# [[a5372]]Note that
link:jaxb.html#a1084[See Binding of an anonymous complex type
definition]” defines the name and package property for anonymous type
definitions occurring within an element declaration.
[.footnoteNumber]# 22.# [[a5373]]Element substitution
extensibility does allow element substitution(s) to be defined in a
separate schema than a global element reference occurs. When schemas are
not compiled at same time, the schema to java binding declaration,
<jaxb:property generateElementProperty=”true”/> described in
link:jaxb.html#a1786[See Usage] forces the generation of an
element property for a global element reference, independent of it not
belonging to a element substitution group.
[.footnoteNumber]# 23.# [[a5374]]The desire to reduce
the overall number of schema-derived classes generated by default
influenced the decision to default to binding an element declaration to
an element instance factory. A customization described in
link:jaxb.html#a1580[See <globalBindings> Declaration] exists
that binds each element declaration to a Java element class so element
substitution checking can be enforced entirely by strongly typed method
signatures.
[.footnoteNumber]# 24.# [[a5375]]Specifying a
customization of the local element declaration A within Derived complex
type to a different property name than A would avoid the fallback
position for this case.
[.footnoteNumber]# 25.# [[a5376]]Note that primitive
Java types must be represented by their Java wrapper classes when base
type is used in the choice content property method signatures. Also, all
sequence descendants of the choice are treated as either a general
content property or are mapped to their own value class.
[.footnoteNumber]# 26.# [[a5377]]XML schema does not
associate anonymous types with a specific symbol space. However,
_nameXmlTransform_ is used since it provides a convenient way to
......
......@@ -152,7 +152,7 @@ relevant to the application. The _binder_ enables _partial binding_ of
the relevant parts of the XML document to a content tree and
_marshalling_ updates back to the original XML document.
=== [[a23]]Goals
=== Goals
The JAXB architecture is designed with the
goals outlined here in mind.
......
......@@ -34,7 +34,7 @@ There must be a detailed, unambiguous
description of the default mapping of schema components to Java
representations in order to satisfy the portability goal.
==== [[a165]]Customized Binding Schema
==== Customized Binding Schema
A binding schema language and its formats must
be specified. There must be a means to describe the binding without
......@@ -90,7 +90,7 @@ interface. This capability enables the schema derived instance to be
passed as EJB method parameter and to any other API that requires
Serializable instances.
===== [[a179]]Disabling Databinding
===== Disabling Databinding
A customization to disable databinding must be
specified. When databinding is disabled, an XML Schema component is
......@@ -101,14 +101,14 @@ operations.
=== Java to XML Schema
==== [[a182]]Default Mapping
==== Default Mapping
A default mapping Java constructs to XML
Schema must be specified. The default mapping may be overridden by
customizations described in link:jaxb.html#a184[See Customized
Mapping]”.
==== [[a184]]Customized Mapping
==== Customized Mapping
A customization mechanism to override default
mapping of Java constructs to XML Schema constructs must be specified.
......
......@@ -258,7 +258,7 @@ changes to JAXB 1.0 schema to java binding rules as well as the
introduction of a flexible unmarshalling mode. These changes are
described in link:jaxb.html#a379[See Unmarshalling Modes]”.
==== [[a256]]Validation
==== Validation
The constraints expressed in a schema fall
into three general categories:
......
......@@ -62,7 +62,7 @@ JAXB implementation’s runtime framework. Users are required to
regenerate the schema-derived implementation classes when changing JAXB
implementations.
=== [[a298]]JAXBContext
=== JAXBContext
The `JAXBContext` class provides the clients
entry point to the JAXB API. It provides an abstraction for managing the
......@@ -178,7 +178,7 @@ to at least `jakarta.xml.bind` module.
====
=== [[a326]]General Validation Processing
=== General Validation Processing
Three identifiable forms of validation exist
within the JAXB architecture include:
......@@ -399,7 +399,7 @@ processing than per class defined callback methods. The external
listener receives events when unmarshalling to a JAXB element or to JAXB
mapped class.
==== [[a379]]Unmarshalling Modes
==== Unmarshalling Modes
There exist numerous use cases requiring the
ability to unmarshal invalid XML content. A flexible unmarshalling mode
......@@ -434,7 +434,7 @@ implementation classes, link:jaxb.html#a536[See Java Content
Interface], can implement either structural unmarshalling or flexible
unmarshalling.
==== [[a386]]Flexible Unmarshalling
==== Flexible Unmarshalling
To address the rigidness of structural
unmarshalling, flexible unmarshalling mode is specified to enable
......@@ -477,7 +477,7 @@ link:jaxb.html#a3855[See Appendix],
link:jaxb.html#a3856[See Runtime Processing]. Flexible
unmarshalling is required for JAXB annotated classes.
=== [[a397]]Marshalling
=== Marshalling
The `Marshaller` class is responsible for
governing the process of serializing a Java content tree into XML data.
......
......@@ -29,7 +29,7 @@ is necessary to rigorously define a standard way to perform this mapping
so all implementations of this specification perform the mapping in the
same compatible manner.
=== [[a482]]Java Package
=== Java Package
Just as the target XML namespace provides a
naming context for the named type definitions, named model groups,
......@@ -66,7 +66,7 @@ signature for each bound element declaration.
public JAXBElement<T> createFoo(T elementValue);
** Dynamic instance factory allocator method signature:
public Object newInstance(Class javaContentInterface);
** Property setter/getter +
......@@ -100,8 +100,8 @@ Default derived Java code:
----
package com.example.PO1;
import jakarta.xml.bind.JAXBElement;
public class PurchaseOrderType { .... };
public Comment { String getValue(){...} void setValue(String){...} }
public class PurchaseOrderType {...};
public Comment { String getValue() {...} void setValue(String) {...} }
...
public class ObjectFactory {
PurchaseOrderType createPurchaseOrderType();
......@@ -175,7 +175,7 @@ children element content of a complex type definition are represented as
properties of the Java content representation. Property representations
are introduced in link:jaxb.html#a541[See Properties].
==== [[a521]]Value Class
==== Value Class
A value class consists of:
......@@ -233,7 +233,7 @@ factory method signature generated in the containing Java package’s
Bar.Foo createBarFoo() {...}
==== [[a536]]Java Content Interface
==== Java Content Interface
JAXB 1.0 bound a complex type definition to a
content interface. This binding is similar to the value class binding
......@@ -250,7 +250,7 @@ two binding styles.
signatures for the set of properties it contains, while a value class
contains method implementations.
=== [[a541]]Properties
=== Properties
The schema compiler binds local schema
components to _properties_ within a Java value class.
......@@ -399,7 +399,7 @@ represent a nillable element declaration, setting a collection item to
`null` is the semantic equivalent of removing an optional element from
the collection property.
===== [[a572]]Indexed Property
===== Indexed Property
This property follows the indexed property
design pattern for a multi-valued property from the JavaBean
......@@ -502,7 +502,7 @@ public Items.ItemType getItem(int index);
public int getItemLength();
----
===== [[a595]]List Property
===== List Property
A list property `prop` with base type _Type_
is realized by the method where `List`
......@@ -582,7 +582,7 @@ link:jaxb.html#a1580[See <globalBindings> Declaration]” and
link:jaxb.html#a1783[See <property> Declaration] describe how
to use this attribute.
==== [[a610]] `isSet` Property Modifier
==== `isSet` Property Modifier
This optional modifier augments a modifiable
property to enable the manipulation of the propertys value as
......@@ -668,7 +668,7 @@ Schema. That the attribute actually has a value is a local structural
constraint rather than a type constraint, so it is checked during
validation rather than during mutation.
==== [[a630]]Element Property
==== Element Property
This property pattern enables the dynamic
association of an element name for a JAXB property. Typically, the
......@@ -711,7 +711,7 @@ control than provided by the core properties. For example, the `isSet`
property modifier enables an application to determine if a propertys
value is set or not.
=== [[a642]]Java Element Representation
=== Java Element Representation
Based on rationale and criteria described in
link:jaxb.html#a1023[See Element Declaration], the schema
......@@ -734,7 +734,7 @@ definition]”.] The customized binding that generates
a schema-dervied Element class for an element declaration is described
in link:jaxb.html#a657[See Java Element Class].
==== [[a645]]Named Java Element instance
==== Named Java Element instance
Based on the normative binding details
described in link:jaxb.html#a1040[See Bind to JAXBElement<T>
......@@ -771,7 +771,7 @@ class ObjectFactory {
}
----
==== [[a657]]Java Element Class
==== Java Element Class
Based on criteria to be identified in
link:jaxb.html#a1068[See Bind to Element Class], the schema
......@@ -834,19 +834,19 @@ manipulate
Xml Schemas type substitution capability is enabled by this property.
** whether the elements content model is `nil`
*_Example:_* +:
Given a complex type definition with mixed content:
[source,xml,indent=4,subs="+macros"]
----
<xs:complexType name="AComplexType" mixed="true">footnote:[Bind mixed
*_Example:_* +
Given a complex type definition with mixed contentfootnote:[Bind mixed
content describes why <ASimpleElement> element is bound to a Java
Element representation.]
<xs:sequence>
<xs:element name="ASimpleElement" type="xs:int"/>footnote:[Assume a
Element representation.]footnote:[Assume a
customization that binds this local element declaration to an element
class. By default, this local declaration binds to a element instance
factory returning JAXBElement<Integer>]
factory returning JAXBElement<Integer>]:
[source,xml,indent=4]
----
<xs:complexType name="AComplexType" mixed="true">
<xs:sequence>
<xs:element name="ASimpleElement" type="xs:int"/>
</xs:sequence>
</xs:complexType>
----
......@@ -869,7 +869,7 @@ class ObjectFactory {
}
----
==== [[a680]]Java Element Representation Summary
==== Java Element Representation Summary
Element declaration binding evolved in JAXB
v2.0 to support XML Schema type substitution. The following diagrams
......
......@@ -2,7 +2,7 @@
// Copyright (c) 2020 Contributors to the Eclipse Foundation
//
== [[a3815]]Compatibility
== Compatibility
This section describes conformance
requirements for an implementor of this specification. A JAXB
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment