本文整理汇总了Java中com.sun.tools.xjc.ConsoleErrorReporter类的典型用法代码示例。如果您正苦于以下问题:Java ConsoleErrorReporter类的具体用法?Java ConsoleErrorReporter怎么用?Java ConsoleErrorReporter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ConsoleErrorReporter类属于com.sun.tools.xjc包,在下文中一共展示了ConsoleErrorReporter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: importTypes
import com.sun.tools.xjc.ConsoleErrorReporter; //导入依赖的package包/类
/**
* Import the Types from the WSDL definition using the same strategy that Cxf uses taking advantage of JAXB
*/
protected void importTypes(Types types) {
SchemaCompiler compiler = XJC.createSchemaCompiler();
ErrorListener elForRun = new ConsoleErrorReporter();
compiler.setErrorListener(elForRun);
Element rootTypes = this.getRootTypes();
this.createDefaultStructures(rootTypes);
S2JJAXBModel intermediateModel = this.compileModel(types, compiler, rootTypes);
Collection<? extends Mapping> mappings = intermediateModel.getMappings();
for (Mapping mapping : mappings) {
this.importStructure(mapping);
}
}
示例2: importTypes
import com.sun.tools.xjc.ConsoleErrorReporter; //导入依赖的package包/类
/**
* Import the Types from the WSDL definition using the same strategy that
* Cxf uses taking advantage of JAXB
*/
private void importTypes(Types types) {
SchemaCompiler compiler = XJC.createSchemaCompiler();
ErrorListener elForRun = new ConsoleErrorReporter();
compiler.setErrorListener(elForRun);
Element rootTypes = this.getRootTypes();
this.createDefaultStructures(rootTypes);
S2JJAXBModel intermediateModel = this.compileModel(types, compiler, rootTypes);
Collection<? extends Mapping> mappings = intermediateModel.getMappings();
for (Mapping mapping : mappings){
this.importStructure(mapping);
}
}
示例3: compilesSchema
import com.sun.tools.xjc.ConsoleErrorReporter; //导入依赖的package包/类
@Test
public void compilesSchema() throws Exception {
new File("target/generated-sources/xjc").mkdirs();
URL schema = getClass().getResource("/schema.xsd");
URL binding = getClass().getResource("/binding.xjb");
final String[] arguments = new String[] { "-xmlschema",
schema.toExternalForm(), "-b", binding.toExternalForm(), "-d",
"target/generated-sources/xjc", "-extension", "-XhashCode",
"-Xequals", "-XtoString", "-Xcopyable", "-Xmergeable",
"-Xinheritance", "-Xsetters", "-Xsetters-mode=direct",
"-Xwildcard", "-XenumValue"
// "-XsimpleToString"
};
Options options = new Options();
options.parseArguments(arguments);
ConsoleErrorReporter receiver = new ConsoleErrorReporter();
Model model = ModelLoader.load(options, new JCodeModel(), receiver);
model.generateCode(options, receiver);
com.sun.codemodel.CodeWriter cw = options.createCodeWriter();
model.codeModel.build(cw);
}
示例4: compilesCustomer
import com.sun.tools.xjc.ConsoleErrorReporter; //导入依赖的package包/类
@Test
public void compilesCustomer() throws Exception {
new File("target/generated-sources/xjc").mkdirs();
URL schema = getClass().getResource("/customer.xsd");
URL binding = getClass().getResource("/customer.xjb");
final String[] arguments = new String[] { "-xmlschema",
schema.toExternalForm(), "-b", binding.toExternalForm(), "-d",
"target/generated-sources/xjc", "-extension",
"-XsimpleHashCode",
// "-XsimpleEquals", "-XsimpleToString"
};
Options options = new Options();
options.parseArguments(arguments);
ConsoleErrorReporter receiver = new ConsoleErrorReporter();
Model model = ModelLoader.load(options, new JCodeModel(), receiver);
model.generateCode(options, receiver);
com.sun.codemodel.CodeWriter cw = options.createCodeWriter();
model.codeModel.build(cw);
}
示例5: compilesSchema
import com.sun.tools.xjc.ConsoleErrorReporter; //导入依赖的package包/类
@Test
public void compilesSchema() throws Exception {
new File("target/generated-sources/xjc").mkdirs();
URL schema = getClass().getResource("/main.xsd");
URL binding = getClass().getResource("/main.xjb");
final String[] arguments = new String[] { "-xmlschema",
schema.toExternalForm(), "-b", binding.toExternalForm(), "-d",
"target/generated-sources/xjc", "-extension",
"-XsimpleHashCode",
// "-XsimpleEquals", "-XsimpleToString"
};
Options options = new Options();
options.parseArguments(arguments);
ConsoleErrorReporter receiver = new ConsoleErrorReporter();
Model model = ModelLoader.load(options, new JCodeModel(), receiver);
model.generateCode(options, receiver);
com.sun.codemodel.CodeWriter cw = options.createCodeWriter();
model.codeModel.build(cw);
}
示例6: compilesSchema
import com.sun.tools.xjc.ConsoleErrorReporter; //导入依赖的package包/类
@Test
public void compilesSchema() throws Exception {
new File("target/generated-sources/xjc").mkdirs();
URL schema = getClass().getResource("/cases.xsd");
// URL binding = getClass().getResource("/cases.xjb");
final String[] arguments = new String[] { "-xmlschema",
schema.toExternalForm(),
// "-b", binding.toExternalForm(),
"-d", "target/generated-sources/xjc", "-extension",
"-XsimpleHashCode", "-XsimpleEquals",
// "-XsimpleToString"
};
Options options = new Options();
options.parseArguments(arguments);
ConsoleErrorReporter receiver = new ConsoleErrorReporter();
Model model = ModelLoader.load(options, new JCodeModel(), receiver);
model.generateCode(options, receiver);
com.sun.codemodel.CodeWriter cw = options.createCodeWriter();
model.codeModel.build(cw);
}
示例7: compilesSchema
import com.sun.tools.xjc.ConsoleErrorReporter; //导入依赖的package包/类
@Test
public void compilesSchema() throws Exception {
new File("target/generated-sources/xjc").mkdirs();
URL schema = getClass().getResource("/schema.xsd");
URL binding = getClass().getResource("/binding.xjb");
final String[] arguments = new String[] { "-xmlschema",
schema.toExternalForm(), "-b", binding.toExternalForm(), "-d",
"target/generated-sources/xjc", "-extension", "-Xsimplify", "-Xsimplify-usePluralForm=true"};
Options options = new Options();
options.parseArguments(arguments);
ConsoleErrorReporter receiver = new ConsoleErrorReporter();
Model model = ModelLoader.load(options, new JCodeModel(), receiver);
model.generateCode(options, receiver);
com.sun.codemodel.CodeWriter cw = options.createCodeWriter();
model.codeModel.build(cw);
}
示例8: compilesContext_V_1_1_0
import com.sun.tools.xjc.ConsoleErrorReporter; //导入依赖的package包/类
@Test
public void compilesContext_V_1_1_0() throws Exception {
new File("target/generated-sources/xjc").mkdirs();
final String[] arguments = new String[] { "-xmlschema",
new File("src/main/resources/schema.xsd").toURI().toString(),
"-d",
"target/generated-sources/xjc",
"-XfixJAXB1058",
"-extension", "-XtoString",
"-Xequals", "-XhashCode", "-Xcopyable", "-Xmergeable"};
Options options = new Options();
options.parseArguments(arguments);
ConsoleErrorReporter receiver = new ConsoleErrorReporter();
Model model = ModelLoader.load(options, new JCodeModel(), receiver);
model.generateCode(options, receiver);
com.sun.codemodel.CodeWriter cw = options.createCodeWriter();
model.codeModel.build(cw);
}
示例9: compilesSchema
import com.sun.tools.xjc.ConsoleErrorReporter; //导入依赖的package包/类
@Test
public void compilesSchema() throws Exception {
new File("target/generated-sources/xjc").mkdirs();
URL schema = getClass().getResource("/schema.xsd");
URL binding = getClass().getResource("/bindings.xjb");
final String[] arguments = new String[] { "-xmlschema",
schema.toExternalForm(), "-b", binding.toExternalForm(), "-d",
"target/generated-sources/xjc", "-extension", "-Xsimplify", "-Xsimplify-usePluralForm=true"};
Options options = new Options();
options.parseArguments(arguments);
ConsoleErrorReporter receiver = new ConsoleErrorReporter();
Model model = ModelLoader.load(options, new JCodeModel(), receiver);
model.generateCode(options, receiver);
com.sun.codemodel.CodeWriter cw = options.createCodeWriter();
model.codeModel.build(cw);
}
示例10: compilesSchema
import com.sun.tools.xjc.ConsoleErrorReporter; //导入依赖的package包/类
@Test
public void compilesSchema() throws Exception {
new File("target/generated-sources/xjc").mkdirs();
URL schema = getClass().getResource("/schema.xsd");
URL binding = getClass().getResource("/binding.xjb");
final String[] arguments = new String[] { "-xmlschema",
schema.toExternalForm(), "-b", binding.toExternalForm(), "-d",
"target/generated-sources/xjc", "-extension", "-XtoString",
"-Xequals", "-XhashCode", "-Xcopyable", "-Xmergeable" };
Options options = new Options();
options.parseArguments(arguments);
ConsoleErrorReporter receiver = new ConsoleErrorReporter();
Model model = ModelLoader.load(options, new JCodeModel(), receiver);
model.generateCode(options, receiver);
com.sun.codemodel.CodeWriter cw = options.createCodeWriter();
model.codeModel.build(cw);
}
示例11: compilesIssues
import com.sun.tools.xjc.ConsoleErrorReporter; //导入依赖的package包/类
@Test
public void compilesIssues() throws Exception {
new File("target/generated-sources/xjc").mkdirs();
URL schema = getClass().getResource("/schema.xsd");
URL binding = getClass().getResource("/binding.xjb");
final String[] arguments = new String[] {
"-xmlschema", schema.toExternalForm(),
"-b", binding.toExternalForm(),
"-d", "target/generated-sources/xjc",
"-extension",
"-Xjsonix",
"-Xjsonix-generateJsonSchema"
};
Options options = new Options();
options.parseArguments(arguments);
ConsoleErrorReporter receiver = new ConsoleErrorReporter();
Model model = ModelLoader.load(options, new JCodeModel(), receiver);
model.generateCode(options, receiver);
com.sun.codemodel.CodeWriter cw = options.createCodeWriter();
model.codeModel.build(cw);
}
示例12: compilesBasicZero
import com.sun.tools.xjc.ConsoleErrorReporter; //导入依赖的package包/类
@Test
public void compilesBasicZero() throws Exception {
new File("target/generated-sources/basic/zero").mkdirs();
final String[] arguments = new String[] {
"-xmlschema",
getClass().getResource("/basic/zero/schema.xsd")
.toExternalForm(), "-d",
"target/generated-sources/basic/zero", "-extension", "-Xjsonix", "-Xjsonix-generateJsonSchema"
};
Options options = new Options();
options.parseArguments(arguments);
ConsoleErrorReporter receiver = new ConsoleErrorReporter();
Model model = ModelLoader.load(options, new JCodeModel(), receiver);
model.generateCode(options, receiver);
com.sun.codemodel.CodeWriter cw = options.createCodeWriter();
model.codeModel.build(cw);
}
示例13: compilesOWS_V_1_1_0
import com.sun.tools.xjc.ConsoleErrorReporter; //导入依赖的package包/类
@Test
public void compilesOWS_V_1_1_0() throws Exception {
new File("target/generated-sources/ows-v_1_1_0").mkdirs();
URL schema = getClass().getResource("/ogc/ows/1.1.0/owsAll.xsd");
URL binding = getClass().getResource("/ogc/ows-v_1_1_0.xjb");
final String[] arguments = new String[] { "-xmlschema",
schema.toExternalForm(), "-b", binding.toExternalForm(), "-d",
"target/generated-sources/ows-v_1_1_0", "-extension",
"-Xjsonix"
};
Options options = new Options();
options.parseArguments(arguments);
ConsoleErrorReporter receiver = new ConsoleErrorReporter();
Model model = ModelLoader.load(options, new JCodeModel(), receiver);
model.generateCode(options, receiver);
com.sun.codemodel.CodeWriter cw = options.createCodeWriter();
model.codeModel.build(cw);
}
示例14: compilesWFS_V_2_0
import com.sun.tools.xjc.ConsoleErrorReporter; //导入依赖的package包/类
@Test
public void compilesWFS_V_2_0() throws Exception {
new File("target/generated-sources/wfs-v_2_0").mkdirs();
URL schema = getClass().getResource("/ogc/wfs/2.0/wfs.xsd");
URL binding = getClass().getResource("/ogc/wfs-v_2_0.xjb");
final String[] arguments = new String[] { "-xmlschema",
schema.toExternalForm(), "-b", binding.toExternalForm(), "-d",
"target/generated-sources/wfs-v_2_0", "-extension", "-Xjsonix"
};
Options options = new Options();
options.parseArguments(arguments);
ConsoleErrorReporter receiver = new ConsoleErrorReporter();
Model model = ModelLoader.load(options, new JCodeModel(), receiver);
model.generateCode(options, receiver);
com.sun.codemodel.CodeWriter cw = options.createCodeWriter();
model.codeModel.build(cw);
}
示例15: compilesContext_V_1_1_0
import com.sun.tools.xjc.ConsoleErrorReporter; //导入依赖的package包/类
@Test
public void compilesContext_V_1_1_0() throws Exception {
new File("target/generated-sources/context-v_1_1_0").mkdirs();
final String[] arguments = new String[] {
"-xmlschema",
getClass().getResource("/ogc/context/1.1.0/wmcAll.xsd")
.toExternalForm(),
"-b",
getClass().getResource("/ogc/context-v_1_1_0.xjb")
.toExternalForm(), "-d",
"target/generated-sources/context-v_1_1_0", "-extension",
"-Xjsonix"
};
Options options = new Options();
options.parseArguments(arguments);
ConsoleErrorReporter receiver = new ConsoleErrorReporter();
Model model = ModelLoader.load(options, new JCodeModel(), receiver);
model.generateCode(options, receiver);
com.sun.codemodel.CodeWriter cw = options.createCodeWriter();
model.codeModel.build(cw);
}