Skip to content

Commit d06dccc

Browse files
committed
Issue #22.
1 parent 6024448 commit d06dccc

11 files changed

+42
-38
lines changed

Diff for: compiler/src/main/java/org/hisrc/jsonix/compilation/jsonschema/JsonSchemaClassInfoCompiler.java renamed to compiler/src/main/java/org/hisrc/jsonix/compilation/jsonschema/JsonSchemaClassInfoProducer.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
import org.jvnet.jaxb2_commons.xml.bind.model.MClassTypeInfo;
1818
import org.jvnet.jaxb2_commons.xml.bind.model.MPropertyInfo;
1919

20-
public class JsonSchemaClassInfoCompiler<T, C extends T> implements
21-
JsonSchemaTypeInfoCompiler<MClassInfo<T, C>, T, C> {
20+
public class JsonSchemaClassInfoProducer<T, C extends T> implements
21+
JsonSchemaTypeInfoProducer<MClassInfo<T, C>, T, C> {
2222

2323
private final JsonSchemaMappingCompiler<T, C> mappingCompiler;
2424
private final Mapping<T, C> mapping;
2525

26-
public JsonSchemaClassInfoCompiler(
26+
public JsonSchemaClassInfoProducer(
2727
JsonSchemaMappingCompiler<T, C> mappingCompiler) {
2828
Validate.notNull(mappingCompiler);
2929
this.mappingCompiler = mappingCompiler;
@@ -35,7 +35,7 @@ public JsonSchemaMappingCompiler<T, C> getMappingCompiler() {
3535
}
3636

3737
@Override
38-
public JsonSchemaBuilder compile(MClassInfo<T, C> classInfo) {
38+
public JsonSchemaBuilder produce(MClassInfo<T, C> classInfo) {
3939
final JsonSchemaBuilder classInfoSchema = new JsonSchemaBuilder();
4040
classInfoSchema.addType(JsonSchemaConstants.OBJECT_TYPE);
4141
final String localName = classInfo
@@ -85,7 +85,7 @@ private Map<String, JsonSchemaBuilder> compilePropertyInfos(
8585
propertyInfoSchemas
8686
.put(propertyInfo.getPrivateName(),
8787
propertyInfo
88-
.acceptPropertyInfoVisitor(new JsonSchemaPropertyInfoCompilerVisitor<T, C>(
88+
.acceptPropertyInfoVisitor(new JsonSchemaPropertyInfoProducerVisitor<T, C>(
8989
this)));
9090
}
9191
}

Diff for: compiler/src/main/java/org/hisrc/jsonix/compilation/jsonschema/JsonSchemaEnumLeafInfoCompiler.java renamed to compiler/src/main/java/org/hisrc/jsonix/compilation/jsonschema/JsonSchemaEnumLeafInfoProducer.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
import org.jvnet.jaxb2_commons.xml.bind.model.MEnumLeafInfo;
1111
import org.jvnet.jaxb2_commons.xml.bind.model.MTypeInfo;
1212

13-
public class JsonSchemaEnumLeafInfoCompiler<T, C extends T> implements
14-
JsonSchemaTypeInfoCompiler<MEnumLeafInfo<T, C>, T, C> {
13+
public class JsonSchemaEnumLeafInfoProducer<T, C extends T> implements
14+
JsonSchemaTypeInfoProducer<MEnumLeafInfo<T, C>, T, C> {
1515

1616
private final JsonSchemaMappingCompiler<T, C> mappingCompiler;
1717

18-
public JsonSchemaEnumLeafInfoCompiler(
18+
public JsonSchemaEnumLeafInfoProducer(
1919
JsonSchemaMappingCompiler<T, C> mappingCompiler) {
2020
Validate.notNull(mappingCompiler);
2121
this.mappingCompiler = mappingCompiler;
@@ -26,7 +26,7 @@ public JsonSchemaMappingCompiler<T, C> getMappingCompiler() {
2626
}
2727

2828
@Override
29-
public JsonSchemaBuilder compile(MEnumLeafInfo<T, C> enumLeafInfo) {
29+
public JsonSchemaBuilder produce(MEnumLeafInfo<T, C> enumLeafInfo) {
3030
final JsonSchemaBuilder enumLeafInfoSchema = new JsonSchemaBuilder();
3131
final String localName = enumLeafInfo
3232
.getContainerLocalName(JsonixConstants.DEFAULT_SCOPED_NAME_DELIMITER);

Diff for: compiler/src/main/java/org/hisrc/jsonix/compilation/jsonschema/JsonSchemaMappingCompiler.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,11 @@ private void addElementInfos(final JsonSchemaBuilder schema) {
9090
}
9191

9292
private void addElementLeafInfoSchemas(final JsonSchemaBuilder schema) {
93-
final JsonSchemaEnumLeafInfoCompiler<T, C> enumLeafInfoCompiler = new JsonSchemaEnumLeafInfoCompiler<T, C>(
93+
final JsonSchemaEnumLeafInfoProducer<T, C> enumLeafInfoCompiler = new JsonSchemaEnumLeafInfoProducer<T, C>(
9494
this);
9595
for (MEnumLeafInfo<T, C> enumLeafInfo : mapping.getEnumLeafInfos()) {
9696
final JsonSchemaBuilder enumLeafInfoSchema = enumLeafInfoCompiler
97-
.compile(enumLeafInfo);
97+
.produce(enumLeafInfo);
9898
schema.addDefinition(
9999
enumLeafInfo
100100
.getContainerLocalName(JsonixConstants.DEFAULT_SCOPED_NAME_DELIMITER),
@@ -103,11 +103,11 @@ private void addElementLeafInfoSchemas(final JsonSchemaBuilder schema) {
103103
}
104104

105105
private void addClassInfoSchemas(final JsonSchemaBuilder schema) {
106-
final JsonSchemaClassInfoCompiler<T, C> classInfoCompiler = new JsonSchemaClassInfoCompiler<T, C>(
106+
final JsonSchemaClassInfoProducer<T, C> classInfoCompiler = new JsonSchemaClassInfoProducer<T, C>(
107107
this);
108108
for (MClassInfo<T, C> classInfo : mapping.getClassInfos()) {
109109
final JsonSchemaBuilder classInfoSchema = classInfoCompiler
110-
.compile(classInfo);
110+
.produce(classInfo);
111111
schema.addDefinition(
112112
classInfo
113113
.getContainerLocalName(JsonixConstants.DEFAULT_SCOPED_NAME_DELIMITER),
@@ -117,7 +117,7 @@ private void addClassInfoSchemas(final JsonSchemaBuilder schema) {
117117

118118
public JsonSchemaBuilder createTypeInfoSchemaRef(MTypeInfo<T, C> typeInfo) {
119119
return typeInfo
120-
.acceptTypeInfoVisitor(new JsonSchemaRefTypeInfoCompilerVisitor<T, C>(
120+
.acceptTypeInfoVisitor(new JsonSchemaRefTypeInfoProducerVisitor<T, C>(
121121
this));
122122
}
123123
}

Diff for: compiler/src/main/java/org/hisrc/jsonix/compilation/jsonschema/JsonSchemaModuleCompiler.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313

1414
public class JsonSchemaModuleCompiler<T, C extends T> {
1515

16-
private final JsonSchemaModulesCompiler<T, C> modulesCompiler;
16+
private final JsonSchemaModulesGenerator<T, C> modulesCompiler;
1717
private final Modules<T, C> modules;
1818
private final Module<T, C> module;
1919

2020
// private final JsonSchema jsonSchema;
2121

2222
public JsonSchemaModuleCompiler(
23-
JsonSchemaModulesCompiler<T, C> modulesCompiler,
23+
JsonSchemaModulesGenerator<T, C> modulesCompiler,
2424
Module<T, C> module, JsonSchema jsonSchema) {
2525
Validate.notNull(modulesCompiler);
2626
Validate.notNull(module);
@@ -31,7 +31,7 @@ public JsonSchemaModuleCompiler(
3131
// this.jsonSchema = jsonSchema;
3232
}
3333

34-
public JsonSchemaModulesCompiler<T, C> getModulesCompiler() {
34+
public JsonSchemaModulesGenerator<T, C> getModulesCompiler() {
3535
return modulesCompiler;
3636
}
3737

Diff for: compiler/src/main/java/org/hisrc/jsonix/compilation/jsonschema/JsonSchemaModulesCompiler.java renamed to compiler/src/main/java/org/hisrc/jsonix/compilation/jsonschema/JsonSchemaModulesGenerator.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
import org.hisrc.jsonix.definition.Modules;
1111
import org.hisrc.jsonix.jsonschema.JsonSchemaBuilder;
1212

13-
public class JsonSchemaModulesCompiler<T, C extends T> {
13+
public class JsonSchemaModulesGenerator<T, C extends T> {
1414

1515
private final Modules<T, C> modules;
1616

17-
public JsonSchemaModulesCompiler(Modules<T, C> modules) {
17+
public JsonSchemaModulesGenerator(Modules<T, C> modules) {
1818
Validate.notNull(modules);
1919
this.modules = modules;
2020
}
@@ -23,7 +23,7 @@ public Modules<T, C> getModules() {
2323
return modules;
2424
}
2525

26-
public void compile(JsonStructureWriter<T, C> writer) {
26+
public void generate(JsonStructureWriter<T, C> writer) {
2727
final JsonProvider provider = JsonProvider.provider();
2828
final JsonBuilderFactory builderFactory = provider
2929
.createBuilderFactory(null);

Diff for: compiler/src/main/java/org/hisrc/jsonix/compilation/jsonschema/JsonSchemaPropertyInfoCompilerVisitor.java renamed to compiler/src/main/java/org/hisrc/jsonix/compilation/jsonschema/JsonSchemaPropertyInfoProducerVisitor.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@
2525
import org.jvnet.jaxb2_commons.xml.bind.model.MValuePropertyInfo;
2626
import org.jvnet.jaxb2_commons.xml.bind.model.MWrappable;
2727

28-
public class JsonSchemaPropertyInfoCompilerVisitor<T, C extends T> implements
28+
public class JsonSchemaPropertyInfoProducerVisitor<T, C extends T> implements
2929
MPropertyInfoVisitor<T, C, JsonSchemaBuilder> {
3030

31-
private final JsonSchemaClassInfoCompiler<T, C> classInfoCompiler;
31+
private final JsonSchemaClassInfoProducer<T, C> classInfoCompiler;
3232

33-
public JsonSchemaPropertyInfoCompilerVisitor(
34-
JsonSchemaClassInfoCompiler<T, C> classInfoCompiler) {
33+
public JsonSchemaPropertyInfoProducerVisitor(
34+
JsonSchemaClassInfoProducer<T, C> classInfoCompiler) {
3535
Validate.notNull(classInfoCompiler);
3636
this.classInfoCompiler = classInfoCompiler;
3737
}
3838

39-
public JsonSchemaClassInfoCompiler<T, C> getClassInfoCompiler() {
39+
public JsonSchemaClassInfoProducer<T, C> getClassInfoCompiler() {
4040
return classInfoCompiler;
4141
}
4242

Diff for: compiler/src/main/java/org/hisrc/jsonix/compilation/jsonschema/JsonSchemaRefTypeInfoCompilerVisitor.java renamed to compiler/src/main/java/org/hisrc/jsonix/compilation/jsonschema/JsonSchemaRefTypeInfoProducerVisitor.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import org.jvnet.jaxb2_commons.xml.bind.model.MTypeInfoVisitor;
2626
import org.jvnet.jaxb2_commons.xml.bind.model.MWildcardTypeInfo;
2727

28-
public class JsonSchemaRefTypeInfoCompilerVisitor<T, C extends T> implements
28+
public class JsonSchemaRefTypeInfoProducerVisitor<T, C extends T> implements
2929
MTypeInfoVisitor<T, C, JsonSchemaBuilder> {
3030

3131
private final JsonSchemaMappingCompiler<T, C> mappingCompiler;
@@ -34,7 +34,7 @@ public class JsonSchemaRefTypeInfoCompilerVisitor<T, C extends T> implements
3434
private final Mapping<T, C> mapping;
3535
private final Map<QName, String> typeNameSchemaRefs;
3636

37-
public JsonSchemaRefTypeInfoCompilerVisitor(
37+
public JsonSchemaRefTypeInfoProducerVisitor(
3838
JsonSchemaMappingCompiler<T, C> mappingCompiler) {
3939
Validate.notNull(mappingCompiler);
4040
this.mappingCompiler = mappingCompiler;

Diff for: compiler/src/main/java/org/hisrc/jsonix/compilation/jsonschema/JsonSchemaTypeInfoCompiler.java renamed to compiler/src/main/java/org/hisrc/jsonix/compilation/jsonschema/JsonSchemaTypeInfoProducer.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import org.hisrc.jsonix.jsonschema.JsonSchemaBuilder;
44
import org.jvnet.jaxb2_commons.xml.bind.model.MTypeInfo;
55

6-
public interface JsonSchemaTypeInfoCompiler<MTI extends MTypeInfo<T, C>, T, C extends T> {
6+
public interface JsonSchemaTypeInfoProducer<MTI extends MTypeInfo<T, C>, T, C extends T> {
77

8-
public JsonSchemaBuilder compile(MTI typeInfo);
8+
public JsonSchemaBuilder produce(MTI typeInfo);
99
}

Diff for: compiler/src/main/java/org/hisrc/jsonix/compilation/jsonschema/JsonixJsonSchemaConstants.java

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
package org.hisrc.jsonix.compilation.jsonschema;
22

3+
import org.hisrc.jsonix.jsonschema.JsonSchemaKeywords;
4+
35
public class JsonixJsonSchemaConstants {
46

57
private JsonixJsonSchemaConstants() {
68
}
79

8-
public static final String BASE_URI = "http://highsource.github.io/jsonix/jsonschemas";
10+
public static final String JSONIX_BASE_URI = "http://highsource.github.io/jsonix";
11+
public static final String JSONIX_JSONSCHEMAS_BASE_URI = JSONIX_BASE_URI
12+
+ "/jsonschemas";
913

10-
public static final String JSONIX_JSON_SCHEMA_ID = BASE_URI
14+
public static final String JSONIX_JSON_SCHEMA_ID = JSONIX_JSONSCHEMAS_BASE_URI
1115
+ "/jsonix/Jsonix.jsonschema#";
1216

1317
public static final String CALENDAR_TYPE_INFO_SCHEMA_REF = JSONIX_JSON_SCHEMA_ID
14-
+ "/definitions/calendar";
18+
+ "/" + JsonSchemaKeywords.definitions + "/calendar";
1519
public static final String WILDCARD_TYPE_INFO_SCHEMA_REF = JSONIX_JSON_SCHEMA_ID
16-
+ "/definitions/wildcard";
20+
+ "/" + JsonSchemaKeywords.definitions + "/wildcard";
1721
public static final String DOM_TYPE_INFO_SCHEMA_REF = JSONIX_JSON_SCHEMA_ID
18-
+ "/definitions/dom";
22+
+ "/" + JsonSchemaKeywords.definitions + "/dom";
1923

2024
public static String TYPE_TYPE_PROPERTY_NAME = "typeType";
2125

Diff for: compiler/src/main/java/org/hisrc/jsonix/compilation/jsonschema/XmlSchemaJsonSchemaConstants.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class XmlSchemaJsonSchemaConstants {
1414
private XmlSchemaJsonSchemaConstants() {
1515
}
1616

17-
public static final String SCHEMA_ID = JsonixJsonSchemaConstants.BASE_URI
17+
public static final String SCHEMA_ID = JsonixJsonSchemaConstants.JSONIX_JSONSCHEMAS_BASE_URI
1818
+ "/w3c/2001/XMLSchema.jsonschema#";
1919

2020
public static final Map<QName, String> TYPE_NAME_SCHEMA_REFS;

Diff for: compiler/src/main/java/org/hisrc/jsonix/execution/JsonixInvoker.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.hisrc.jsonix.execution;
22

3-
import org.hisrc.jsonix.compilation.jsonschema.JsonSchemaModulesCompiler;
3+
import org.hisrc.jsonix.compilation.jsonschema.JsonSchemaModulesGenerator;
44
import org.hisrc.jsonix.compilation.jsonschema.JsonStructureWriter;
55
import org.hisrc.jsonix.compilation.mapping.ModulesCompiler;
66
import org.hisrc.jsonix.compilation.mapping.ProgramWriter;
@@ -63,8 +63,8 @@ public void execute(Settings settings, Model model,
6363

6464
modulesCompiler.compile(programWriter);
6565

66-
final JsonSchemaModulesCompiler<NType, NClass> jsonSchemaModulesCompiler = new JsonSchemaModulesCompiler<NType, NClass>(
66+
final JsonSchemaModulesGenerator<NType, NClass> jsonSchemaModulesGenerator = new JsonSchemaModulesGenerator<NType, NClass>(
6767
modules);
68-
jsonSchemaModulesCompiler.compile(jsonStructureWriter);
68+
jsonSchemaModulesGenerator.generate(jsonStructureWriter);
6969
}
7070
}

0 commit comments

Comments
 (0)