Powered by SmartDoc

Overview

The Java generator supports extension syntaxes embedding information in RELAX schemas. Relaxer generates special code using the information.

Syntax

The namespace of extension syntax for java is a http://www.relaxer.org/xmlns/relaxer/java.

Usually java is used for a prefix to represent namespace the namespace http://www.relaxer.org/xmlns/relaxer/java. Nonetheless, you may use any prefix.

There are following three kind of targets:

Target 'class' means that extension syntax applies to classes. (e.g. class name)

Target 'property' means that extension sytanx applies to attributes of classes. (e.g. attribute name)

Target 'data' means that extension sytax applies to type of attributes. (e.g. attribute type)

Table 8.1.1.1[target and element] shows mappings between the target and the element of RELAX grammars, both RELAX NG and RELAX Core.

target and element
target RELAX NG RELAX Core note
class define elementRule
contentRule
element element
property element element
attribute attribute
ref ref
hedgeRef
data data elementRule
element
attribute

Attributes

The Java generator supports the following attributes for this extension syntax:

Table 8.1.2.1[List of the extionsion attributes for the Java geneartor] is a list of the extension attributes for the Java generator.

List of the extionsion attributes for the Java geneartor
attribute target function
default property default value of the target property
className class class name of the target class
propertyName property property name of the target property
dataType data data type of the target data
dataClass data implementation class name of the target data
extends class base class of the target class
implements class specifies user defined interfaces implmented by the target class
abstract class indicates the target class is a abstract class
mapKey property specify the target property uses map-key facility
role class specify role interfaces