当前位置: 首页>>代码示例>>Java>>正文


Java Options类代码示例

本文整理汇总了Java中com.sun.tools.xjc.Options的典型用法代码示例。如果您正苦于以下问题:Java Options类的具体用法?Java Options怎么用?Java Options使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Options类属于com.sun.tools.xjc包,在下文中一共展示了Options类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: run

import com.sun.tools.xjc.Options; //导入依赖的package包/类
@Override
public boolean run(Outline outline, Options options, ErrorHandler errorHandler) {
    // for each generated classes
    for (ClassOutline generatedClassOutline : outline.getClasses()) {
        JDefinedClass generatedClass = generatedClassOutline.implClass;
        if (!isAbstractClass(generatedClass) &&
                !generatedClass.fields().isEmpty()) {
            boolean commandExecuted = false;
            for (Command command : commands.values()) {
                if (command.isEnabled()) {
                    command.editGeneratedClass(generatedClass);
                    commandExecuted = true;
                }
            }

            if (!commandExecuted) {
                defaultCommand.editGeneratedClass(generatedClass);
            }
        }
    }
    return true;
}
 
开发者ID:svzdvd,项目名称:jaxb-lombok-plugin,代码行数:23,代码来源:LombokPlugin.java

示例2: run

import com.sun.tools.xjc.Options; //导入依赖的package包/类
@Override
public boolean run(Outline outline, Options opt, ErrorHandler errorHandler) throws Exception {
    PluginImpl clonePlugin = new PluginImpl();
    clonePlugin.run(outline, opt, errorHandler);

    Set<Map.Entry<NClass, CClassInfo>> set = outline.getModel().beans().entrySet();
    for (Map.Entry<NClass, CClassInfo> entry : set) {
        ClassOutline classOutline = outline.getClazz(entry.getValue());
        if (isPrism(classOutline)) {
            removeConstructors(classOutline);
            removeCloneableMethod(classOutline);

            removePrivateStaticCopyMethods(classOutline);
            createCloneMethod(classOutline);
        }
    }

    return true;
}
 
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:20,代码来源:CloneProcessor.java

示例3: SchemaCompilerEx

import com.sun.tools.xjc.Options; //导入依赖的package包/类
public SchemaCompilerEx() {
    opts.compatibilityMode = Options.EXTENSION;
    resetSchema();

    if(System.getProperty("xjc-api.test")!=null) {
        opts.debugMode = true;
        opts.verbose = true;
    }
}
 
开发者ID:maxep,项目名称:max-ws,代码行数:10,代码来源:SchemaCompilerEx.java

示例4: compilesSchema

import com.sun.tools.xjc.Options; //导入依赖的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);
}
 
开发者ID:highsource,项目名称:jaxb2-basics,代码行数:26,代码来源:RunPlugins.java

示例5: compilesSchema

import com.sun.tools.xjc.Options; //导入依赖的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);
	}
 
开发者ID:highsource,项目名称:jaxb2-basics,代码行数:23,代码来源:RunPluginsForMain.java

示例6: compilesSchema

import com.sun.tools.xjc.Options; //导入依赖的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);
}
 
开发者ID:highsource,项目名称:jaxb2-basics,代码行数:25,代码来源:RunPluginsForCases.java

示例7: compilesSchema

import com.sun.tools.xjc.Options; //导入依赖的package包/类
@Test
public void compilesSchema() throws Exception {

	new File("target/generated-sources/xjc").mkdirs();

	String schemaDirectory = new File(getClass().getResource("/schema.xsd")
			.toURI()).getParentFile().getAbsolutePath();
	String bindingDirectory = new File(getClass().getResource(
			"/binding.xjb").toURI()).getParentFile().getAbsolutePath();
	final String[] arguments = new String[] { "-xmlschema",
			schemaDirectory, "-b", bindingDirectory, "-d",
			"target/generated-sources/xjc", "-extension", "-Xannotate"

	};

	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);
}
 
开发者ID:highsource,项目名称:jaxb2-annotate-plugin,代码行数:24,代码来源:RunPlugins.java

示例8: compilesSchema

import com.sun.tools.xjc.Options; //导入依赖的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);
}
 
开发者ID:highsource,项目名称:jaxb2-basics,代码行数:20,代码来源:RunSimplifyPlugin.java

示例9: compilesSchema

import com.sun.tools.xjc.Options; //导入依赖的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);
}
 
开发者ID:highsource,项目名称:jaxb2-basics,代码行数:21,代码来源:RunPlugins.java

示例10: compilesWFS_V_2_0

import com.sun.tools.xjc.Options; //导入依赖的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);
}
 
开发者ID:highsource,项目名称:jsonix-schema-compiler,代码行数:22,代码来源:JsonixPluginTest.java

示例11: run

import com.sun.tools.xjc.Options; //导入依赖的package包/类
@Override
public boolean run(Outline outline, Options opt, ErrorHandler errorHandler) {
	for (final ClassOutline classOutline : outline.getClasses()) {
		if (classOutline.target.getElementName() != null) {
			processGlobalElement(classOutline);
		} else {
			processGlobalComplexType(classOutline);
		}
	}
	for (final CElementInfo elementInfo : outline.getModel()
			.getAllElements()) {
		final ElementOutline elementOutline = outline
				.getElement(elementInfo);
		if (elementOutline != null) {
			processGlobalJAXBElement(elementOutline);
		}
	}
	return true;
}
 
开发者ID:highsource,项目名称:jaxb2-basics,代码行数:20,代码来源:AutoInheritancePlugin.java

示例12: run

import com.sun.tools.xjc.Options; //导入依赖的package包/类
@Override
public boolean run(Outline outline, Options opt, ErrorHandler errorHandler) {

	for (final PackageOutline packageOutline : outline
			.getAllPackageContexts()) {
		final StringBuilder sb = new StringBuilder();
		for (final ClassOutline classOutline : packageOutline.getClasses()) {
			sb.append(CodeModelUtils.getLocalClassName(classOutline.ref));
			sb.append("\n");
		}

		final JTextFile indexFile = new JTextFile("jaxb.index");
		indexFile.setContents(sb.toString());
		packageOutline._package().addResourceFile(indexFile);
	}
	return true;
}
 
开发者ID:highsource,项目名称:jaxb2-basics,代码行数:18,代码来源:JaxbIndexPlugin.java

示例13: run

import com.sun.tools.xjc.Options; //导入依赖的package包/类
@Override
public boolean run(Outline outline, Options opt,
		final ErrorHandler errorHandler) throws SAXException {

	final Model model = outline.getModel();
	final JCodeModel codeModel = outline.getCodeModel();

	final ProgramWriter<NType, NClass> programWriter = new CodeModelProgramWriter(
			codeModel, errorHandler);

	final JsonStructureWriter<NType, NClass> jsonStructureWriter = new CodeModelJsonStructureWriter(
			codeModel, errorHandler);

	new JsonixInvoker().execute(getSettings(), model, programWriter,
			jsonStructureWriter);

	return true;
}
 
开发者ID:highsource,项目名称:jsonix-schema-compiler,代码行数:19,代码来源:JsonixPlugin.java

示例14: loadModel

import com.sun.tools.xjc.Options; //导入依赖的package包/类
public MModelInfo<NType, NClass> loadModel(String resource)
		throws Exception {
	System.setProperty("javax.xml.accessExternalSchema", "all");

	new File("target/generated-sources/" + resource).mkdirs();
	final String[] arguments = new String[] { "-xmlschema",
			getClass().getResource("/" + resource).toExternalForm(), "-d",
			"target/generated-sources/" + resource, "-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);

	final MModelInfo<NType, NClass> modelInfo = new XJCCMInfoFactory(model)
			.createModel();

	return modelInfo;
}
 
开发者ID:highsource,项目名称:jsonix-schema-compiler,代码行数:24,代码来源:MModelInfoLoader.java

示例15: parseArgument

import com.sun.tools.xjc.Options; //导入依赖的package包/类
@Override
public int parseArgument(Options opt, String[] args, int start)
		throws BadCommandLineException, IOException {
	final int result = super.parseArgument(opt, args, start);

	for (int i = 0; i < args.length; i++) {
		if (args[i].length() != 0) {
			if (args[i].charAt(0) != '-') {
				if (args[i].endsWith(".jar")) {
					episodeURLs.add(new File(args[i]).toURI().toURL());
				}
			}
		}
	}
	return result;
}
 
开发者ID:highsource,项目名称:hyperjaxb3,代码行数:17,代码来源:EjbPlugin.java


注:本文中的com.sun.tools.xjc.Options类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。