diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 062adf4..dac21f4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,7 +28,7 @@ jobs: mkdir -p $BUILD_DIR ARTIFACT_ID="sax" - VERSION="0.9.5-SNAPSHOT" + VERSION="1.0.0-SNAPSHOT" CLASSIFIER="bundle" JAR="$ARTIFACT_ID-$VERSION-$CLASSIFIER.jar" diff --git a/examples/array.jsdx b/examples/array.jsdx index b5214a9..3c281e0 100644 --- a/examples/array.jsdx +++ b/examples/array.jsdx @@ -15,9 +15,9 @@ program. If not, see . --> diff --git a/examples/complete.jsdx b/examples/complete.jsdx index 4298714..23dfc71 100644 --- a/examples/complete.jsdx +++ b/examples/complete.jsdx @@ -15,9 +15,9 @@ program. If not, see . --> diff --git a/examples/datatype.jsdx b/examples/datatype.jsdx index 94e09ea..717d9b7 100644 --- a/examples/datatype.jsdx +++ b/examples/datatype.jsdx @@ -15,9 +15,9 @@ program. If not, see . --> diff --git a/examples/reference.jsdx b/examples/reference.jsdx index 8276161..d4fda32 100644 --- a/examples/reference.jsdx +++ b/examples/reference.jsdx @@ -15,9 +15,9 @@ program. If not, see . --> diff --git a/examples/reserved.jsdx b/examples/reserved.jsdx index 111512f..aba8798 100644 --- a/examples/reserved.jsdx +++ b/examples/reserved.jsdx @@ -15,9 +15,9 @@ program. If not, see . --> diff --git a/examples/structure.jsdx b/examples/structure.jsdx index 7333401..4c6fc25 100644 --- a/examples/structure.jsdx +++ b/examples/structure.jsdx @@ -15,9 +15,9 @@ program. If not, see . --> diff --git a/examples/template.jsdx b/examples/template.jsdx index cc73aa4..dd3b2a1 100644 --- a/examples/template.jsdx +++ b/examples/template.jsdx @@ -15,9 +15,9 @@ program. If not, see . --> diff --git a/schema-0.4/schema-0.4.jsd b/schema-0.4/schema-0.4.jsd index a5e6d64..da64ab5 100644 --- a/schema-0.4/schema-0.4.jsd +++ b/schema-0.4/schema-0.4.jsd @@ -1,7 +1,7 @@ { - "jx:ns": "http://www.jsonx.org/schema-0.4.jsd", - "jx:schemaLocation": "http://www.jsonx.org/schema-0.4.jsd http://www.jsonx.org/schema-0.4.jsd", - "jx:targetNamespace": "http://www.jsonx.org/schema-0.4.jsd", + "jx:ns": "http://www.jsonx.org/schema-0.5.jsd", + "jx:schemaLocation": "http://www.jsonx.org/schema-0.5.jsd http://www.jsonx.org/schema-0.5.jsd", + "jx:targetNamespace": "http://www.jsonx.org/schema-0.5.jsd", "min": { "jx:type": "string", "pattern": "\\d+" @@ -39,12 +39,12 @@ "properties": { "jx:ns": { "jx:type": "string", - "pattern": "http://www.jsonx.org/schema-0.4.jsd", + "pattern": "http://www.jsonx.org/schema-0.5.jsd", "nullable": false }, "jx:schemaLocation": { "jx:type": "string", - "pattern": "http://www.jsonx.org/schema-0.4.jsd [^ ]+", + "pattern": "http://www.jsonx.org/schema-0.5.jsd [^ ]+", "use": "optional", "nullable": false }, diff --git a/schema-0.5/schema-0.5.jsd b/schema-0.5/schema-0.5.jsd new file mode 100644 index 0000000..da64ab5 --- /dev/null +++ b/schema-0.5/schema-0.5.jsd @@ -0,0 +1,710 @@ +{ + "jx:ns": "http://www.jsonx.org/schema-0.5.jsd", + "jx:schemaLocation": "http://www.jsonx.org/schema-0.5.jsd http://www.jsonx.org/schema-0.5.jsd", + "jx:targetNamespace": "http://www.jsonx.org/schema-0.5.jsd", + "min": { + "jx:type": "string", + "pattern": "\\d+" + }, + "max": { + "jx:type": "string", + "pattern": "\\d+|unbounded" + }, + "use": { + "jx:type": "string", + "pattern": "required|optional" + }, + "nonEmptyString": { + "jx:type": "string", + "pattern": "\\S|\\S.*\\S" + }, + "documented": { + "jx:type": "object", + "abstract": true, + "properties": { + "doc": { + "jx:type": "string", + "doc": "Defines text comments. Optional." + } + } + }, + "member": { + "jx:type": "object", + "abstract": true, + "extends": "documented" + }, + "schema": { + "jx:type": "object", + "extends": "documented", + "properties": { + "jx:ns": { + "jx:type": "string", + "pattern": "http://www.jsonx.org/schema-0.5.jsd", + "nullable": false + }, + "jx:schemaLocation": { + "jx:type": "string", + "pattern": "http://www.jsonx.org/schema-0.5.jsd [^ ]+", + "use": "optional", + "nullable": false + }, + "jx:targetNamespace": { + "jx:type": "reference", + "type": "nonEmptyString", + "use": "optional", + "nullable": false + }, + "[a-zA-Z_][-a-zA-Z\\d_]*": { + "jx:type": "any", + "types": "array boolean number objectType string", + "nullable": false, + "bindings": [{ + "lang": "java", + "field": "declarations" + }] + } + } + }, + "typeIdentifier": { + "jx:type": "string", + "pattern": "(([a-zA-Z_$][a-zA-Z\\d_$]*)\\.)*[a-zA-Z_$][a-zA-Z\\d_$]*(\\[\\])?" + }, + "methodIdentifier": { + "jx:type": "string", + "pattern": "(([a-zA-Z_$][a-zA-Z\\d_$]*)\\.)*[a-zA-Z_$][a-zA-Z\\d_$]*(\\.)?" + }, + "fieldIdentifier": { + "jx:type": "string", + "pattern": "[a-zA-Z_$][a-zA-Z\\d_$]*" + }, + "binding": { + "jx:type": "object", + "abstract": true, + "properties": { + "lang": { + "jx:type": "reference", + "type": "nonEmptyString", + "nullable": false, + "doc": "Specifies the language to which this binding applies." + } + } + }, + "fieldBinding": { + "jx:type": "object", + "extends": "binding", + "doc": "Specifies language-specific binding.", + "properties": { + "field": { + "jx:type": "reference", + "type": "fieldIdentifier", + "use": "optional", + "nullable": false, + "doc": "Specifies the \"field\" identifier." + } + } + }, + "typeBinding": { + "jx:type": "object", + "extends": "binding", + "doc": "Specifies language-specific binding.", + "properties": { + "type": { + "jx:type": "reference", + "type": "typeIdentifier", + "use": "optional", + "nullable": false, + "doc": "Specifies the \"type\" qualified identifier." + }, + "decode": { + "jx:type": "reference", + "type": "methodIdentifier", + "use": "optional", + "nullable": false, + "doc": "Specifies the \"decode\" qualified function identifier that accepts input as a string, or as the native JSON type of this property, and returns an output of the specified \"type\" (or the default type if \"type\" is unspecified)." + }, + "encode": { + "jx:type": "reference", + "type": "methodIdentifier", + "use": "optional", + "nullable": false, + "doc": "Specifies the \"encode\" qualified function identifier that accepts input of the type specified in \"type\" (or the default type if \"type\" is unspecified), and returns an output as a string, or as the native JSON type of this property." + } + } + }, + "typeFieldBinding": { + "jx:type": "object", + "extends": "typeBinding", + "doc": "Specifies language-specific binding.", + "properties": { + "field": { + "jx:type": "reference", + "type": "fieldIdentifier", + "use": "optional", + "nullable": false, + "doc": "Specifies the \"field\" identifier." + } + } + }, + "fieldBindings": { + "jx:type": "array", + "doc": "Specifies language-specific bindings.", + "elements": [{ + "jx:type": "reference", + "type": "fieldBinding", + "nullable": false + }] + }, + "typeBindings": { + "jx:type": "array", + "doc": "Specifies language-specific bindings.", + "elements": [{ + "jx:type": "reference", + "type": "typeBinding", + "nullable": false + }] + }, + "typeFieldBindings": { + "jx:type": "array", + "doc": "Specifies language-specific bindings.", + "elements": [{ + "jx:type": "reference", + "type": "typeFieldBinding", + "nullable": false + }] + }, + "any": { + "jx:type": "object", + "abstract": true, + "extends": "member", + "properties": { + "jx:type": { + "jx:type": "string", + "pattern": "any", + "nullable": false + }, + "types": { + "jx:type": "reference", + "type": "nonEmptyString", + "use": "optional", + "nullable": false + } + } + }, + "array": { + "jx:type": "object", + "extends": "member", + "properties": { + "jx:type": { + "jx:type": "string", + "pattern": "array", + "nullable": false + }, + "minIterate": { + "jx:type": "reference", + "type": "min", + "use": "optional", + "nullable": false, + "doc": "Specifies the minimum inclusive number of iterations of child elements. Default: 1." + }, + "maxIterate": { + "jx:type": "reference", + "type": "max", + "use": "optional", + "nullable": false, + "doc": "Specifies the maximum inclusive number of iterations of child elements. Default: 1." + }, + "elements": { + "jx:type": "array", + "maxIterate": "unbounded", + "nullable": false, + "elements": [{ + "jx:type": "reference", + "type": "anyElement", + "minOccurs": "0", + "nullable": false + }, { + "jx:type": "reference", + "type": "arrayElement", + "minOccurs": "0", + "nullable": false + }, { + "jx:type": "reference", + "type": "booleanElement", + "minOccurs": "0", + "nullable": false + }, { + "jx:type": "reference", + "type": "numberElement", + "minOccurs": "0", + "nullable": false + }, { + "jx:type": "reference", + "type": "referenceElement", + "minOccurs": "0", + "nullable": false + }, { + "jx:type": "reference", + "type": "stringElement", + "minOccurs": "0", + "nullable": false + }, { + "jx:type": "reference", + "type": "objectElement", + "minOccurs": "0", + "nullable": false + }] + } + } + }, + "boolean": { + "jx:type": "object", + "extends": "member", + "properties": { + "jx:type": { + "jx:type": "string", + "pattern": "boolean", + "nullable": false + }, + "bindings": { + "jx:type": "reference", + "type": "typeBindings", + "use": "optional", + "nullable": false + } + } + }, + "number": { + "jx:type": "object", + "extends": "member", + "properties": { + "jx:type": { + "jx:type": "string", + "pattern": "number", + "nullable": false + }, + "range": { + "jx:type": "string", + "pattern": "[\\(\\[](-?(0|[1-9]\\d*)(\\.\\d+)?([eE][+-]?([1-9]\\d*))?)?,(-?(0|[1-9]\\d*)(\\.\\d+)?([eE][+-]?([1-9]\\d*))?)?[\\)\\]]", + "use": "optional", + "nullable": false, + "doc": "Specifies the value range in interval notation:\n Open (exclusive) interval: (min,max)\n Closed (inclusive) interval: [min,max]\n Half-open or half-closed interval: [min,max)\n Degenerate interval: [val]" + }, + "scale": { + "jx:type": "number", + "scale": 0, + "use": "optional", + "nullable": false, + "doc": "The number of digits to the right of the decimal point. If a value is not specified, the scale is unbounded." + }, + "bindings": { + "jx:type": "reference", + "type": "typeBindings", + "use": "optional", + "nullable": false + } + } + }, + "object": { + "jx:type": "object", + "abstract": true, + "extends": "member", + "properties": { + "jx:type": { + "jx:type": "string", + "pattern": "object", + "nullable": false + }, + "extends": { + "jx:type": "string", + "use": "optional", + "nullable": false, + "doc": "Specifies the name of the type to extend. Optional." + }, + "properties": { + "jx:type": "object", + "use": "optional", + "nullable": false, + "properties": { + ".*": { + "jx:type": "any", + "types": "anyProperty arrayProperty booleanProperty numberProperty objectProperty referenceProperty stringProperty", + "nullable": false, + "bindings": [{ + "lang": "java", + "field": "properties" + }] + } + } + } + } + }, + "objectType": { + "jx:type": "object", + "extends": "object", + "properties": { + "abstract": { + "jx:type": "boolean", + "use": "optional", + "nullable": false, + "doc": "Specifies whether the object is abstract. Default: false." + } + } + }, + "reference": { + "jx:type": "object", + "abstract": true, + "extends": "member", + "properties": { + "jx:type": { + "jx:type": "string", + "pattern": "reference", + "nullable": false + }, + "type": { + "jx:type": "reference", + "type": "nonEmptyString", + "nullable": false, + "doc": "Specifies the name of the referenced type. Required." + } + } + }, + "string": { + "jx:type": "object", + "extends": "member", + "properties": { + "jx:type": { + "jx:type": "string", + "pattern": "string", + "nullable": false + }, + "pattern": { + "jx:type": "reference", + "type": "nonEmptyString", + "use": "optional", + "nullable": false + }, + "bindings": { + "jx:type": "reference", + "type": "typeBindings", + "use": "optional", + "nullable": false + } + } + }, + "anyProperty": { + "jx:type": "object", + "extends": "any", + "properties": { + "nullable": { + "jx:type": "boolean", + "use": "optional", + "nullable": false + }, + "use": { + "jx:type": "reference", + "type": "use", + "use": "optional", + "nullable": false + }, + "bindings": { + "jx:type": "reference", + "type": "fieldBindings", + "use": "optional", + "nullable": false + } + } + }, + "arrayProperty": { + "jx:type": "object", + "extends": "array", + "properties": { + "nullable": { + "jx:type": "boolean", + "use": "optional", + "nullable": false + }, + "use": { + "jx:type": "reference", + "type": "use", + "use": "optional", + "nullable": false + }, + "bindings": { + "jx:type": "reference", + "type": "fieldBindings", + "use": "optional", + "nullable": false + } + } + }, + "booleanProperty": { + "jx:type": "object", + "extends": "boolean", + "properties": { + "nullable": { + "jx:type": "boolean", + "use": "optional", + "nullable": false + }, + "use": { + "jx:type": "reference", + "type": "use", + "use": "optional", + "nullable": false + }, + "bindings": { + "jx:type": "reference", + "type": "typeFieldBindings" + } + } + }, + "numberProperty": { + "jx:type": "object", + "extends": "number", + "properties": { + "nullable": { + "jx:type": "boolean", + "use": "optional", + "nullable": false + }, + "use": { + "jx:type": "reference", + "type": "use", + "use": "optional", + "nullable": false + }, + "bindings": { + "jx:type": "reference", + "type": "typeFieldBindings" + } + } + }, + "objectProperty": { + "jx:type": "object", + "extends": "object", + "properties": { + "nullable": { + "jx:type": "boolean", + "use": "optional", + "nullable": false + }, + "use": { + "jx:type": "reference", + "type": "use", + "use": "optional", + "nullable": false + }, + "bindings": { + "jx:type": "reference", + "type": "fieldBindings", + "use": "optional", + "nullable": false + } + } + }, + "referenceProperty": { + "jx:type": "object", + "extends": "reference", + "properties": { + "nullable": { + "jx:type": "boolean", + "use": "optional", + "nullable": false + }, + "use": { + "jx:type": "reference", + "type": "use", + "use": "optional", + "nullable": false + }, + "bindings": { + "jx:type": "reference", + "type": "fieldBindings", + "use": "optional", + "nullable": false + } + } + }, + "stringProperty": { + "jx:type": "object", + "extends": "string", + "properties": { + "nullable": { + "jx:type": "boolean", + "use": "optional", + "nullable": false + }, + "use": { + "jx:type": "reference", + "type": "use", + "use": "optional", + "nullable": false + }, + "bindings": { + "jx:type": "reference", + "type": "typeFieldBindings" + } + } + }, + "anyElement": { + "jx:type": "object", + "extends": "any", + "properties": { + "nullable": { + "jx:type": "boolean", + "use": "optional", + "nullable": false + }, + "minOccurs": { + "jx:type": "reference", + "type": "min", + "use": "optional", + "nullable": false + }, + "maxOccurs": { + "jx:type": "reference", + "type": "max", + "use": "optional", + "nullable": false + } + } + }, + "arrayElement": { + "jx:type": "object", + "extends": "array", + "properties": { + "nullable": { + "jx:type": "boolean", + "use": "optional", + "nullable": false + }, + "minOccurs": { + "jx:type": "reference", + "type": "min", + "use": "optional", + "nullable": false + }, + "maxOccurs": { + "jx:type": "reference", + "type": "max", + "use": "optional", + "nullable": false + } + } + }, + "booleanElement": { + "jx:type": "object", + "extends": "boolean", + "properties": { + "nullable": { + "jx:type": "boolean", + "use": "optional", + "nullable": false + }, + "minOccurs": { + "jx:type": "reference", + "type": "min", + "use": "optional", + "nullable": false + }, + "maxOccurs": { + "jx:type": "reference", + "type": "max", + "use": "optional", + "nullable": false + } + } + }, + "numberElement": { + "jx:type": "object", + "extends": "number", + "properties": { + "nullable": { + "jx:type": "boolean", + "use": "optional", + "nullable": false + }, + "minOccurs": { + "jx:type": "reference", + "type": "min", + "use": "optional", + "nullable": false + }, + "maxOccurs": { + "jx:type": "reference", + "type": "max", + "use": "optional", + "nullable": false + } + } + }, + "objectElement": { + "jx:type": "object", + "extends": "object", + "properties": { + "nullable": { + "jx:type": "boolean", + "use": "optional", + "nullable": false + }, + "minOccurs": { + "jx:type": "reference", + "type": "min", + "use": "optional", + "nullable": false + }, + "maxOccurs": { + "jx:type": "reference", + "type": "max", + "use": "optional", + "nullable": false + } + } + }, + "referenceElement": { + "jx:type": "object", + "extends": "reference", + "properties": { + "nullable": { + "jx:type": "boolean", + "use": "optional", + "nullable": false + }, + "minOccurs": { + "jx:type": "reference", + "type": "min", + "use": "optional", + "nullable": false + }, + "maxOccurs": { + "jx:type": "reference", + "type": "max", + "use": "optional", + "nullable": false + } + } + }, + "stringElement": { + "jx:type": "object", + "extends": "string", + "properties": { + "nullable": { + "jx:type": "boolean", + "use": "optional", + "nullable": false + }, + "minOccurs": { + "jx:type": "reference", + "type": "min", + "use": "optional", + "nullable": false + }, + "maxOccurs": { + "jx:type": "reference", + "type": "max", + "use": "optional", + "nullable": false + } + } + } +} \ No newline at end of file diff --git a/schema-0.5/schema-0.5.jsdx b/schema-0.5/schema-0.5.jsdx new file mode 100644 index 0000000..45a846a --- /dev/null +++ b/schema-0.5/schema-0.5.jsdx @@ -0,0 +1,204 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/schema-0.5/schema-0.5.xsd b/schema-0.5/schema-0.5.xsd new file mode 100644 index 0000000..3aa5efe --- /dev/null +++ b/schema-0.5/schema-0.5.xsd @@ -0,0 +1,655 @@ + + + + + + + + + + Defines text comments. Optional. + + + + + + + + + + + + + + + Specifies whether the element can be null. Default: true. + + + + + + + + Specifies the name. Required. + + + + + + + + Specifies the property use <required|optional>. Default: required. + + + + + + + + + + + + + Identifier pattern that must start with either a capital letter, or must include a '$' followed by a capital letter. + + + + + + + + Specifies the name. Required. + + + + + + + + + + + + + + + Specifies the name of the referenced type. Required. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Specifies the language to which this binding applies. + + + + + + + + + + Specifies the "field" identifier. + + + + + + + + + + + + Specifies the "type" qualified identifier. + + + + + Specifies the "decode" qualified function identifier that accepts input as a string, or as the native JSON type of this property, and returns an output of the specified "type" (or the default type if "type" is unspecified). + + + + + Specifies the "encode" qualified function identifier that accepts input of the type specified in "type" (or the default type if "type" is unspecified), and returns an output as a string, or as the native JSON type of this property. + + + + + + + + + + + + Specifies the "field" identifier. + + + + + + + + + + + + + Specifies language-specific bindings. + + + + + + + + + + + + + + + + Specifies a list of type names. Optional. + + + + + + + + + + + + + + Specifies language-specific bindings. + + + + + + + Specifies the regex pattern of property names. Required. + + + + + + + + + + + + + + + + + + + Specifies language-specific bindings. + + + + + + + + + + + + + + + + + Specifies the value range in interval notation: + Open (exclusive) interval: (min,max) + Closed (inclusive) interval: [min,max] + Half-open or half-closed interval: [min,max) + + + + + + + + + + + + The number of digits to the right of the decimal point. If a value is not specified, the scale is unbounded. + + + + + + + + + + + + + + + Specifies language-specific bindings. + + + + + + + + + + + + + + + + Specifies the regex pattern. + + + + + + + + + + + + + Specifies language-specific bindings. + + + + + + + + + + + + + + + + + + + + Specifies the minimum inclusive number of occurrence of this element. Default: 1. + + + + + Specifies the maximum inclusive number of occurrence of this element. Default: unbounded. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Specifies language-specific bindings. + + + + + + + + + + + + + + + + + + + + + Specifies language-specific bindings. + + + + + + + + + + + + + + + + + + + + + Specifies language-specific bindings. + + + + + + + + + + + + + + + + + + + + + + + + + + + Specifies the minimum inclusive number of iterations of child elements. Default: 1. + + + + + Specifies the maximum inclusive number of iterations of child elements. Default: 1. + + + + + + + + + + + + + Specifies language-specific bindings. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Specifies the name of the type to extend. Optional. + + + + + + + + + + + + + Specifies language-specific bindings. + + + + + + + + + + + + + + + + + + + + + + + + Specifies language-specific bindings. + + + + + + + + + + + + + + + + + + + + Specifies language-specific bindings. + + + + + + + + + + + + + + + + + + + + Specifies language-specific bindings. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Specifies whether the object is abstract. Default: false. + + + + + + + Object cannot extend itself. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/schema.jsd b/schema.jsd index b58b728..96c4332 120000 --- a/schema.jsd +++ b/schema.jsd @@ -1 +1 @@ -schema-0.4/schema-0.4.jsd \ No newline at end of file +schema-0.5/schema-0.5.jsd \ No newline at end of file diff --git a/schema.jsdx b/schema.jsdx index d5d7612..0241ad3 120000 --- a/schema.jsdx +++ b/schema.jsdx @@ -1 +1 @@ -schema-0.4/schema-0.4.jsdx \ No newline at end of file +schema-0.5/schema-0.5.jsdx \ No newline at end of file diff --git a/schema.xsd b/schema.xsd index a496f60..353cda6 120000 --- a/schema.xsd +++ b/schema.xsd @@ -1 +1 @@ -schema-0.4/schema-0.4.xsd \ No newline at end of file +schema-0.5/schema-0.5.xsd \ No newline at end of file