Class NamespacePrefixPlugin
- java.lang.Object
-
- com.sun.tools.xjc.Plugin
-
- org.jvnet.jaxb2_commons.plugin.namespace_prefix.NamespacePrefixPlugin
-
public class NamespacePrefixPlugin extends com.sun.tools.xjc.PluginThis plugin addsXmlNsannotations to package-info.java files. Those annotations tells Jaxb2 to generate XML schema's instances with specific namespaces prefixes, instead of the auto-generated (ns1, ns2, ...) prefixes. Definition of thoses prefixes is done in the bindings.xml file.Bindings.xml file example:
<?xml version="1.0"?> <jxb:bindings version="2.1" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:namespace="http://jaxb2-commons.dev.java.net/namespace-prefix"> <jxb:bindings schemaLocation="unireg-common-1.xsd"> <jxb:schemaBindings> <jxb:package name="ch.vd.unireg.xml.common.v1" /> </jxb:schemaBindings> <jxb:bindings> <namespace:prefix name="common-1" /> </jxb:bindings> </jxb:bindings> </jxb:bindings>- Author:
- Manuel Siggen (c) 2012 Etat-de-Vaud (www.vd.ch)
-
-
Constructor Summary
Constructors Constructor Description NamespacePrefixPlugin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<String>getCustomizationURIs()StringgetOptionName()StringgetUsage()booleanisCustomizationTagName(String nsUri, String localName)booleanrun(com.sun.tools.xjc.outline.Outline outline, com.sun.tools.xjc.Options options, ErrorHandler errorHandler)
-
-
-
Method Detail
-
getOptionName
public String getOptionName()
- Specified by:
getOptionNamein classcom.sun.tools.xjc.Plugin
-
getUsage
public String getUsage()
- Specified by:
getUsagein classcom.sun.tools.xjc.Plugin
-
getCustomizationURIs
public List<String> getCustomizationURIs()
- Overrides:
getCustomizationURIsin classcom.sun.tools.xjc.Plugin
-
isCustomizationTagName
public boolean isCustomizationTagName(String nsUri, String localName)
- Overrides:
isCustomizationTagNamein classcom.sun.tools.xjc.Plugin
-
run
public boolean run(com.sun.tools.xjc.outline.Outline outline, com.sun.tools.xjc.Options options, ErrorHandler errorHandler)- Specified by:
runin classcom.sun.tools.xjc.Plugin
-
-