Skip to content

Commit

Permalink
update spec, chapter 6
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
  • Loading branch information
lukasj committed Aug 4, 2020
1 parent d8eca6d commit 0ab2bc2
Show file tree
Hide file tree
Showing 8 changed files with 1,421 additions and 1,360 deletions.
34 changes: 0 additions & 34 deletions spec/src/main/asciidoc/XMLBinding.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spec/src/main/asciidoc/ch01-introduction.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions spec/src/main/asciidoc/ch02-requirements.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion spec/src/main/asciidoc/ch03-architecture.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions spec/src/main/asciidoc/ch04-binding_framework.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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 client’s
entry point to the JAXB API. It provides an abstraction for managing the
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
50 changes: 25 additions & 25 deletions spec/src/main/asciidoc/ch05-java_representation.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 +
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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:

Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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`
Expand Down Expand Up @@ -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 property’s value as
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -711,7 +711,7 @@ control than provided by the core properties. For example, the `isSet`
property modifier enables an application to determine if a property’s
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
Expand All @@ -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>
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -834,19 +834,19 @@ manipulate
Xml Schema’s type substitution capability is enabled by this property.
** whether the element’s 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>
----
Expand All @@ -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
Expand Down
Loading

0 comments on commit 0ab2bc2

Please sign in to comment.