another round of warnings
Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
diff --git a/jaxb-ri/codemodel/codemodel-annotation-compiler/src/main/java/com/sun/codemodel/ac/ACTask.java b/jaxb-ri/codemodel/codemodel-annotation-compiler/src/main/java/com/sun/codemodel/ac/ACTask.java
index 2ef5235..f64d7de 100644
--- a/jaxb-ri/codemodel/codemodel-annotation-compiler/src/main/java/com/sun/codemodel/ac/ACTask.java
+++ b/jaxb-ri/codemodel/codemodel-annotation-compiler/src/main/java/com/sun/codemodel/ac/ACTask.java
@@ -218,7 +218,7 @@
@Override
public void execute() throws BuildException {
- userLoader = new AntClassLoader(project, classpath);
+ userLoader = new AntClassLoader(getProject(), classpath);
try {
// find clsses to be bound
for (String path : classpath.list()) {
diff --git a/jaxb-ri/codemodel/codemodel/src/test/java/com/sun/codemodel/JExportsTest.java b/jaxb-ri/codemodel/codemodel/src/test/java/com/sun/codemodel/JExportsTest.java
index 3dbca53..d194fcc 100644
--- a/jaxb-ri/codemodel/codemodel/src/test/java/com/sun/codemodel/JExportsTest.java
+++ b/jaxb-ri/codemodel/codemodel/src/test/java/com/sun/codemodel/JExportsTest.java
@@ -24,6 +24,11 @@
public class JExportsTest extends JTestModuleDirective {
/**
+ * Default constructor.
+ */
+ public JExportsTest() {}
+
+ /**
* Test of getType method to make sure that it returns ExportsDirective.
*/
@Test
diff --git a/jaxb-ri/codemodel/codemodel/src/test/java/com/sun/codemodel/JRequiresTest.java b/jaxb-ri/codemodel/codemodel/src/test/java/com/sun/codemodel/JRequiresTest.java
index d88b7c7..9e4ca62 100644
--- a/jaxb-ri/codemodel/codemodel/src/test/java/com/sun/codemodel/JRequiresTest.java
+++ b/jaxb-ri/codemodel/codemodel/src/test/java/com/sun/codemodel/JRequiresTest.java
@@ -23,6 +23,11 @@
public class JRequiresTest extends JTestModuleDirective {
/**
+ * Default constructor.
+ */
+ public JRequiresTest() {}
+
+ /**
* Test of generateModifiers method with all combinations of {@code local) and {@code public) modifiers.
*/
@Test
diff --git a/jaxb-ri/codemodel/codemodel/src/test/java/com/sun/codemodel/JTestModuleDirective.java b/jaxb-ri/codemodel/codemodel/src/test/java/com/sun/codemodel/JTestModuleDirective.java
index d0fd981..b2e039f 100644
--- a/jaxb-ri/codemodel/codemodel/src/test/java/com/sun/codemodel/JTestModuleDirective.java
+++ b/jaxb-ri/codemodel/codemodel/src/test/java/com/sun/codemodel/JTestModuleDirective.java
@@ -21,6 +21,11 @@
*/
public abstract class JTestModuleDirective {
+ /**
+ * Default constructor.
+ */
+ public JTestModuleDirective() {}
+
/** Character array writer used to verify code generation output. */
protected CharArrayWriter out;
diff --git a/jaxb-ri/codemodel/codemodel/src/test/java/com/sun/codemodel/tests/JExprTest.java b/jaxb-ri/codemodel/codemodel/src/test/java/com/sun/codemodel/tests/JExprTest.java
index 4812625..d09e9f5 100644
--- a/jaxb-ri/codemodel/codemodel/src/test/java/com/sun/codemodel/tests/JExprTest.java
+++ b/jaxb-ri/codemodel/codemodel/src/test/java/com/sun/codemodel/tests/JExprTest.java
@@ -13,8 +13,8 @@
import com.sun.codemodel.JExpr;
import com.sun.codemodel.tests.util.CodeModelTestsUtils;
-import junit.framework.Assert;
import junit.framework.TestCase;
+import org.junit.Assert;
/**
* JExpr tests.
diff --git a/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/model/core/NonElement.java b/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/model/core/NonElement.java
index 7b1ae60..b3e890a 100644
--- a/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/model/core/NonElement.java
+++ b/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/model/core/NonElement.java
@@ -11,6 +11,8 @@
package org.glassfish.jaxb.core.v2.model.core;
import org.glassfish.jaxb.core.v2.WellKnownNamespace;
+
+import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
/**
@@ -23,7 +25,7 @@
* @author Kohsuke Kawaguchi
*/
public interface NonElement<T,C> extends TypeInfo<T,C> {
- public static final QName ANYTYPE_NAME = new QName(WellKnownNamespace.XML_SCHEMA, "anyType");
+ public static final QName ANYTYPE_NAME = new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI, "anyType");
/**
* Gets the primary XML type ANYTYPE_NAME of the class.
diff --git a/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/model/nav/ReflectionNavigator.java b/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/model/nav/ReflectionNavigator.java
index 46383b0..74e0f64 100644
--- a/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/model/nav/ReflectionNavigator.java
+++ b/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/model/nav/ReflectionNavigator.java
@@ -130,10 +130,8 @@
/**
* Replaces the type variables in {@code t} by its actual arguments.
*
- * @param decl
- * provides a list of type variables. See {@link GenericDeclaration#getTypeParameters()}
- * @param args
- * actual arguments. See {@link ParameterizedType#getActualTypeArguments()}
+ * @param decl provides a list of type variables. See {@link GenericDeclaration#getTypeParameters()}
+ * @param args actual arguments. See {@link ParameterizedType#getActualTypeArguments()}
*/
private Type bind(Type t, GenericDeclaration decl, ParameterizedType args) {
return binder.visit(t, new BinderArg(decl, args.getActualTypeArguments()));
diff --git a/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/model/nav/SecureLoader.java b/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/model/nav/SecureLoader.java
index be173ab..f9bf2aa 100644
--- a/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/model/nav/SecureLoader.java
+++ b/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/model/nav/SecureLoader.java
@@ -24,6 +24,7 @@
} else {
return java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<ClassLoader>() {
+ @Override
public ClassLoader run() {
return Thread.currentThread().getContextClassLoader();
}
@@ -37,6 +38,7 @@
} else {
return java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<ClassLoader>() {
+ @Override
public ClassLoader run() {
return c.getClassLoader();
}
@@ -50,6 +52,7 @@
} else {
return java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<ClassLoader>() {
+ @Override
public ClassLoader run() {
return ClassLoader.getSystemClassLoader();
}
diff --git a/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/model/util/ArrayInfoUtil.java b/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/model/util/ArrayInfoUtil.java
index 1a541fd..a731569 100644
--- a/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/model/util/ArrayInfoUtil.java
+++ b/jaxb-ri/core/src/main/java/org/glassfish/jaxb/core/v2/model/util/ArrayInfoUtil.java
@@ -10,6 +10,7 @@
package org.glassfish.jaxb.core.v2.model.util;
+import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
import org.glassfish.jaxb.core.v2.TODO;
@@ -29,7 +30,7 @@
*/
public static QName calcArrayTypeName(QName n) {
String uri;
- if(n.getNamespaceURI().equals(WellKnownNamespace.XML_SCHEMA)) {
+ if(n.getNamespaceURI().equals(XMLConstants.W3C_XML_SCHEMA_NS_URI)) {
TODO.checkSpec("this URI");
uri = "http://jaxb.dev.java.net/array";
} else
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ApBasedTask.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ApBasedTask.java
index 85f01de..a4784ba 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ApBasedTask.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ApBasedTask.java
@@ -15,6 +15,7 @@
import org.apache.tools.ant.taskdefs.Javac;
import org.apache.tools.ant.taskdefs.compilers.DefaultCompilerAdapter;
import org.apache.tools.ant.types.Commandline;
+import org.apache.tools.ant.util.StringUtils;
import javax.annotation.processing.Processor;
import javax.tools.DiagnosticCollector;
@@ -35,6 +36,11 @@
public abstract class ApBasedTask extends Javac {
/**
+ * Default constructor.
+ */
+ protected ApBasedTask() {}
+
+ /**
* Implemented by the derived class to set up command line switches passed to annotation processing.
*/
protected abstract void setupCommandlineSwitches(Commandline cmd);
@@ -44,12 +50,14 @@
setJavac(ApBasedTask.this);
}
+ @Override
protected Commandline setupModernJavacCommandlineSwitches(Commandline cmd) {
super.setupModernJavacCommandlineSwitches(cmd);
setupCommandlineSwitches(cmd);
return cmd;
}
+ @Override
protected void logAndAddFilesToCompile(Commandline cmd) {
attributes.log("Compilation " + cmd.describeArguments(),
Project.MSG_VERBOSE);
@@ -60,13 +68,13 @@
}
niceSourceList.append(" to be compiled:");
- niceSourceList.append(lSep);
+ niceSourceList.append(System.lineSeparator());
StringBuilder tempbuilder = new StringBuilder();
for (File aCompileList : compileList) {
String arg = aCompileList.getAbsolutePath();
// cmd.createArgument().setValue(arg); --> we don't need compile list withing cmd arguments
- tempbuilder.append(" ").append(arg).append(lSep);
+ tempbuilder.append(" ").append(arg).append(System.lineSeparator());
niceSourceList.append(tempbuilder);
tempbuilder.setLength(0);
}
@@ -80,10 +88,11 @@
*/
private final class InternalApAdapter extends ApAdapter {
+ @Override
public boolean execute() throws BuildException {
try {
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
- DiagnosticCollector diagnostics = new DiagnosticCollector();
+ DiagnosticCollector<JavaFileObject> diagnostics = new DiagnosticCollector<>();
StandardJavaFileManager fileManager = compiler.getStandardFileManager(diagnostics, null, null);
Iterable<? extends JavaFileObject> compilationUnits = fileManager.getJavaFileObjectsFromFiles(Arrays.asList(compileList));
JavaCompiler.CompilationTask task = compiler.getTask(
@@ -118,6 +127,7 @@
// }
// }
+ @Override
protected void compile() {
if (compileList.length == 0) return;
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ConfigReader.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ConfigReader.java
index 25e140e..53dd51f 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ConfigReader.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ConfigReader.java
@@ -229,7 +229,8 @@
* will be written, and return it as a {@link Result} object.
*
*/
- public Result createOutput( String namespaceUri, String suggestedFileName ) {
+ @Override
+ public Result createOutput(String namespaceUri, String suggestedFileName ) {
// the user's preference takes a precedence
if(schemas.containsKey(namespaceUri)) {
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/NGCCRuntimeEx.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/NGCCRuntimeEx.java
index e6249b7..931a972 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/NGCCRuntimeEx.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/NGCCRuntimeEx.java
@@ -87,7 +87,7 @@
* @return
* A list of regular expression patterns {@link Pattern}
*/
- public List getExcludePatterns(List<String> excludeContent ) {
+ public List<Pattern> getExcludePatterns(List<String> excludeContent ) {
List<Pattern> excludeRegexList = new ArrayList<Pattern>();
for (String excludes : excludeContent) {
String regex = convertToRegex(excludes);
@@ -141,6 +141,7 @@
return regex.toString();
}
+ @Override
protected void unexpectedX(String token) throws SAXException {
errorHandler.error(
new SAXParseException(Messages.UNEXPECTED_NGCC_TOKEN.format(
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/SchemaGenBase.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/SchemaGenBase.java
index 19d8ac1..92cd948 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/SchemaGenBase.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/SchemaGenBase.java
@@ -36,6 +36,11 @@
private boolean fork = false;
+ /**
+ * Default constructor.
+ */
+ public SchemaGenBase() { super(); }
+
private final CommandlineJava cmd = new CommandlineJava();
CommandlineJava getCommandline() {
@@ -48,30 +53,36 @@
private Path modulepath = null;
+ @Override
public void setModulepath(Path mp) {
this.modulepath = mp;
}
+ @Override
public Path getModulepath() {
return this.modulepath;
}
private Path modulesourcepath = null;
+ @Override
public void setModulesourcepath(Path msp) {
this.modulesourcepath = msp;
}
+ @Override
public Path getModulesourcepath() {
return this.modulesourcepath;
}
private Path upgrademodulepath = null;
+ @Override
public void setUpgrademodulepath(Path ump) {
this.upgrademodulepath = ump;
}
+ @Override
public Path getUpgrademodulepath() {
return this.upgrademodulepath;
}
@@ -136,18 +147,22 @@
return this.addopens;
}
+ @Override
protected void setupCommandlineSwitches(Commandline cmd) {
cmd.createArgument().setValue("-proc:only");
}
+ @Override
protected String getCompilationMessage() {
return "Generating schema from ";
}
+ @Override
protected String getFailedMessage() {
return "schema generation failed";
}
+ @Override
public void setFork(boolean flg) {
fork = flg;
}
@@ -174,6 +189,7 @@
return this.episode;
}
+ @Override
protected Processor getProcessor() {
Map<String, File> m = new HashMap<String, File>();
for (SchemaGenBase.Schema schema : schemas) {
@@ -198,6 +214,11 @@
private String namespace;
private File file;
+ /**
+ * Default constructor.
+ */
+ public Schema() {}
+
public void setNamespace(String namespace) {
this.namespace = namespace;
}
@@ -232,7 +253,7 @@
throw (BuildException) ex;
} else {
throw new BuildException("Error starting " + "schemagen" + ": " + ex.getMessage(), ex,
- getLocation());
+ getLocation());
}
}
}
@@ -278,10 +299,10 @@
}
String antcp = loader != null
- //taskedef cp
- ? ((AntClassLoader) loader).getClasspath()
- //system classloader, ie. env CLASSPATH=...
- : System.getProperty("java.class.path");
+ //taskedef cp
+ ? ((AntClassLoader) loader).getClasspath()
+ //system classloader, ie. env CLASSPATH=...
+ : System.getProperty("java.class.path");
// try to find tools.jar and add it to the cp
// so the behaviour on all JDKs is the same
// (avoid creating MaskingClassLoader on non-Mac JDKs)
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/SecureLoader.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/SecureLoader.java
index 325b1df..ded0585 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/SecureLoader.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/SecureLoader.java
@@ -24,6 +24,7 @@
} else {
return java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<ClassLoader>() {
+ @Override
public ClassLoader run() {
return Thread.currentThread().getContextClassLoader();
}
@@ -31,12 +32,13 @@
}
}
- static ClassLoader getClassClassLoader(final Class c) {
+ static ClassLoader getClassClassLoader(final Class<?> c) {
if (System.getSecurityManager() == null) {
return c.getClassLoader();
} else {
return java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<ClassLoader>() {
+ @Override
public ClassLoader run() {
return c.getClassLoader();
}
@@ -50,6 +52,7 @@
} else {
return java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<ClassLoader>() {
+ @Override
public ClassLoader run() {
return ClassLoader.getSystemClassLoader();
}
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ap/Const.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ap/Const.java
index 5a964c4..fa20453 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ap/Const.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ap/Const.java
@@ -22,7 +22,6 @@
/**
* Name of the annotation processing command-line option to take user-specified config files.
* <p>
- * <p>
* It can take multiple file names separately by {@link File#pathSeparator}.
*/
CONFIG_FILE_OPTION("jaxb.config"),
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ap/ErrorReceiverImpl.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ap/ErrorReceiverImpl.java
index 2125b64..0d9292e 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ap/ErrorReceiverImpl.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ap/ErrorReceiverImpl.java
@@ -37,24 +37,28 @@
this(env.getMessager());
}
+ @Override
public void error(SAXParseException exception) {
messager.printMessage(Diagnostic.Kind.ERROR, exception.getMessage());
messager.printMessage(Diagnostic.Kind.ERROR, getLocation(exception));
printDetail(exception);
}
+ @Override
public void fatalError(SAXParseException exception) {
messager.printMessage(Diagnostic.Kind.ERROR, exception.getMessage());
messager.printMessage(Diagnostic.Kind.ERROR, getLocation(exception));
printDetail(exception);
}
+ @Override
public void warning(SAXParseException exception) {
messager.printMessage(Diagnostic.Kind.WARNING, exception.getMessage());
messager.printMessage(Diagnostic.Kind.WARNING, getLocation(exception));
printDetail(exception);
}
+ @Override
public void info(SAXParseException exception) {
printDetail(exception);
}
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ap/SchemaGenerator.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ap/SchemaGenerator.java
index 4657b35..6e91746 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ap/SchemaGenerator.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ap/SchemaGenerator.java
@@ -85,6 +85,7 @@
try {
model.generateSchema(
new SchemaOutputResolver() {
+ @Override
public Result createOutput(String namespaceUri, String suggestedFileName) throws IOException {
File file;
OutputStream out;
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ap/SecureLoader.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ap/SecureLoader.java
index 6636eb9..22e762b 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ap/SecureLoader.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/ap/SecureLoader.java
@@ -24,6 +24,7 @@
} else {
return java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<ClassLoader>() {
+ @Override
public ClassLoader run() {
return Thread.currentThread().getContextClassLoader();
}
@@ -31,12 +32,13 @@
}
}
- static ClassLoader getClassClassLoader(final Class c) {
+ static ClassLoader getClassClassLoader(final Class<?> c) {
if (System.getSecurityManager() == null) {
return c.getClassLoader();
} else {
return java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<ClassLoader>() {
+ @Override
public ClassLoader run() {
return c.getClassLoader();
}
@@ -50,6 +52,7 @@
} else {
return java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<ClassLoader>() {
+ @Override
public ClassLoader run() {
return ClassLoader.getSystemClassLoader();
}
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/api/impl/j2s/JAXBModelImpl.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/api/impl/j2s/JAXBModelImpl.java
index f8a950b..e1bc038 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/api/impl/j2s/JAXBModelImpl.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/api/impl/j2s/JAXBModelImpl.java
@@ -123,10 +123,12 @@
}
}
+ @Override
public List<String> getClassList() {
return classList;
}
+ @Override
public QName getXmlTypeName(Reference javaType) {
NonElement<TypeMirror, TypeElement> ti = refMap.get(javaType);
@@ -149,10 +151,12 @@
return types.getTypeInfo(ref);
}
+ @Override
public void generateSchema(SchemaOutputResolver outputResolver, ErrorListener errorListener) throws IOException {
getSchemaGenerator().write(outputResolver,errorListener);
}
+ @Override
public void generateEpisodeFile(Result output) {
getSchemaGenerator().writeEpisodeFile(ResultFactory.createSerializer(output));
}
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/api/impl/j2s/JavaCompilerImpl.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/api/impl/j2s/JavaCompilerImpl.java
index 1d9228b..455611b 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/api/impl/j2s/JavaCompilerImpl.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/api/impl/j2s/JavaCompilerImpl.java
@@ -41,6 +41,7 @@
* @author Kohsuke Kawaguchi (kk@kohsuke.org)
*/
public class JavaCompilerImpl implements JavaCompiler {
+ @Override
public J2SJAXBModel bind(
Collection<Reference> rootClasses,
Map<QName,Reference> additionalElementDecls,
@@ -87,6 +88,7 @@
this.messager = messager;
}
+ @Override
public void error(IllegalAnnotationException e) {
String error = e.toString();
messager.printMessage(Diagnostic.Kind.ERROR, error);
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/AttributesImpl.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/AttributesImpl.java
index bdb6927..ebcc569 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/AttributesImpl.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/AttributesImpl.java
@@ -102,6 +102,7 @@
* @return The number of attributes in the list.
* @see org.xml.sax.Attributes#getLength
*/
+ @Override
public int getLength ()
{
return length;
@@ -116,6 +117,7 @@
* available, or null if the index is out of range.
* @see org.xml.sax.Attributes#getURI
*/
+ @Override
public String getURI (int index)
{
if (index >= 0 && index < length) {
@@ -134,6 +136,7 @@
* none is available, or null if the index if out of range.
* @see org.xml.sax.Attributes#getLocalName
*/
+ @Override
public String getLocalName (int index)
{
if (index >= 0 && index < length) {
@@ -152,6 +155,7 @@
* none is available, or null if the index is out of bounds.
* @see org.xml.sax.Attributes#getQName
*/
+ @Override
public String getQName (int index)
{
if (index >= 0 && index < length) {
@@ -170,6 +174,7 @@
* if the index is out of bounds.
* @see org.xml.sax.Attributes#getType(int)
*/
+ @Override
public String getType (int index)
{
if (index >= 0 && index < length) {
@@ -187,6 +192,7 @@
* @return The attribute's value or null if the index is out of bounds.
* @see org.xml.sax.Attributes#getValue(int)
*/
+ @Override
public String getValue (int index)
{
if (index >= 0 && index < length) {
@@ -210,6 +216,7 @@
* @return The attribute's index, or -1 if none matches.
* @see org.xml.sax.Attributes#getIndex(java.lang.String,java.lang.String)
*/
+ @Override
public int getIndex (String uri, String localName)
{
int max = length * 5;
@@ -229,6 +236,7 @@
* @return The attribute's index, or -1 if none matches.
* @see org.xml.sax.Attributes#getIndex(java.lang.String)
*/
+ @Override
public int getIndex (String qName)
{
int max = length * 5;
@@ -251,6 +259,7 @@
* matching attribute.
* @see org.xml.sax.Attributes#getType(java.lang.String,java.lang.String)
*/
+ @Override
public String getType (String uri, String localName)
{
int max = length * 5;
@@ -271,6 +280,7 @@
* matching attribute.
* @see org.xml.sax.Attributes#getType(java.lang.String)
*/
+ @Override
public String getType (String qName)
{
int max = length * 5;
@@ -293,6 +303,7 @@
* matching attribute.
* @see org.xml.sax.Attributes#getValue(java.lang.String,java.lang.String)
*/
+ @Override
public String getValue (String uri, String localName)
{
int max = length * 5;
@@ -313,6 +324,7 @@
* matching attribute.
* @see org.xml.sax.Attributes#getValue(java.lang.String)
*/
+ @Override
public String getValue (String qName)
{
int max = length * 5;
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/Classes.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/Classes.java
index 0ef26d9..e78a885 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/Classes.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/Classes.java
@@ -34,6 +34,7 @@
protected String $localName;
protected String $qname;
+ @Override
public final NGCCRuntime getRuntime() {
return($runtime);
}
@@ -62,6 +63,7 @@
private void action3()throws SAXException {
$runtime.processList(__text);}
+ @Override
public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
int $ai;
$uri = $__uri;
@@ -121,6 +123,7 @@
}
}
+ @Override
public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
int $ai;
$uri = $__uri;
@@ -185,6 +188,7 @@
}
}
+ @Override
public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
int $ai;
$uri = $__uri;
@@ -216,6 +220,7 @@
}
}
+ @Override
public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
int $ai;
$uri = $__uri;
@@ -247,6 +252,7 @@
}
}
+ @Override
public void text(String $value) throws SAXException {
int $ai;
switch($_ngcc_current_state) {
@@ -306,6 +312,7 @@
}
}
+ @Override
public void onChildCompleted(Object result, int cookie, boolean needAttCheck)throws SAXException {
switch(cookie) {
}
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/Config.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/Config.java
index 43c56e2..6c17ad7 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/Config.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/Config.java
@@ -35,6 +35,7 @@
protected String $localName;
protected String $qname;
+ @Override
public final NGCCRuntime getRuntime() {
return($runtime);
}
@@ -57,6 +58,7 @@
baseDir = $runtime.getBaseDir(bd);
}
+ @Override
public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
int $ai;
$uri = $__uri;
@@ -132,6 +134,7 @@
}
}
+ @Override
public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
int $ai;
$uri = $__uri;
@@ -179,6 +182,7 @@
}
}
+ @Override
public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
int $ai;
$uri = $__uri;
@@ -214,6 +218,7 @@
}
}
+ @Override
public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
int $ai;
$uri = $__uri;
@@ -249,6 +254,7 @@
}
}
+ @Override
public void text(String $value) throws SAXException {
int $ai;
switch($_ngcc_current_state) {
@@ -281,6 +287,7 @@
}
}
+ @Override
public void onChildCompleted(Object result, int cookie, boolean needAttCheck)throws SAXException {
switch(cookie) {
case 19:
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/NGCCInterleaveFilter.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/NGCCInterleaveFilter.java
index 77eae2a..c7ab920 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/NGCCInterleaveFilter.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/NGCCInterleaveFilter.java
@@ -35,6 +35,7 @@
/** event receiverse. */
protected NGCCEventReceiver[] _receivers;
+ @Override
public int replace(NGCCEventReceiver oldHandler, NGCCEventReceiver newHandler) {
for( int i=0; i<_receivers.length; i++ )
if( _receivers[i]==oldHandler ) {
@@ -76,6 +77,7 @@
*/
private int lockCount=0;
+ @Override
public void enterElement(
String uri, String localName, String qname,Attributes atts) throws SAXException {
@@ -92,6 +94,7 @@
_receivers[lockedReceiver].enterElement(uri,localName,qname,atts);
}
+ @Override
public void leaveElement(String uri, String localName, String qname) throws SAXException {
if(isJoining) return; // ignore any token if we are joining. See joinByXXXX.
@@ -100,6 +103,7 @@
else
_receivers[lockedReceiver].leaveElement(uri,localName,qname);
}
+ @Override
public void enterAttribute(String uri, String localName, String qname) throws SAXException {
if(isJoining) return; // ignore any token if we are joining. See joinByXXXX.
@@ -114,6 +118,7 @@
_receivers[lockedReceiver].enterAttribute(uri,localName,qname);
}
+ @Override
public void leaveAttribute(String uri, String localName, String qname) throws SAXException {
if(isJoining) return; // ignore any token if we are joining. See joinByXXXX.
@@ -122,6 +127,7 @@
else
_receivers[lockedReceiver].leaveAttribute(uri,localName,qname);
}
+ @Override
public void text(String value) throws SAXException {
if(isJoining) return; // ignore any token if we are joining. See joinByXXXX.
@@ -307,30 +313,35 @@
//
//
- public void sendEnterAttribute( int threadId,
- String uri, String local, String qname) throws SAXException {
+ @Override
+ public void sendEnterAttribute(int threadId,
+ String uri, String local, String qname) throws SAXException {
_receivers[threadId].enterAttribute(uri,local,qname);
}
- public void sendEnterElement( int threadId,
- String uri, String local, String qname, Attributes atts) throws SAXException {
+ @Override
+ public void sendEnterElement(int threadId,
+ String uri, String local, String qname, Attributes atts) throws SAXException {
_receivers[threadId].enterElement(uri,local,qname,atts);
}
- public void sendLeaveAttribute( int threadId,
- String uri, String local, String qname) throws SAXException {
+ @Override
+ public void sendLeaveAttribute(int threadId,
+ String uri, String local, String qname) throws SAXException {
_receivers[threadId].leaveAttribute(uri,local,qname);
}
- public void sendLeaveElement( int threadId,
- String uri, String local, String qname) throws SAXException {
+ @Override
+ public void sendLeaveElement(int threadId,
+ String uri, String local, String qname) throws SAXException {
_receivers[threadId].leaveElement(uri,local,qname);
}
+ @Override
public void sendText(int threadId, String value) throws SAXException {
_receivers[threadId].text(value);
}
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/NGCCRuntime.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/NGCCRuntime.java
index fbb10c6..230c8aa 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/NGCCRuntime.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/NGCCRuntime.java
@@ -97,7 +97,8 @@
// current content handler can be acccessed via set/getContentHandler.
private Locator locator;
- public void setDocumentLocator( Locator _loc ) { this.locator=_loc; }
+ @Override
+ public void setDocumentLocator(Locator _loc ) { this.locator=_loc; }
/**
* Gets the source location of the current event.
*
@@ -109,7 +110,7 @@
/** stack of {@link Attributes}. */
- private final Stack<AttributesImpl> attStack = new Stack();
+ private final Stack<AttributesImpl> attStack = new Stack<>();
/** current attributes set. always equal to attStack.peek() */
private AttributesImpl currentAtts;
@@ -134,7 +135,8 @@
/** The current NGCCHandler. Always equals to handlerStack.peek() */
private NGCCEventReceiver currentHandler;
- public int replace( NGCCEventReceiver o, NGCCEventReceiver n ) {
+ @Override
+ public int replace(NGCCEventReceiver o, NGCCEventReceiver n ) {
if(o!=currentHandler)
throw new IllegalStateException(); // bug of RelaxNGCC
currentHandler = n;
@@ -221,6 +223,7 @@
currentHandler.text(t.nextToken());
}
+ @Override
public void startElement(String uri, String localname, String qname, Attributes atts)
throws SAXException {
@@ -265,6 +268,7 @@
nsEffectivePtr = nsEffectiveStack.pop();
}
+ @Override
public void endElement(String uri, String localname, String qname)
throws SAXException {
@@ -290,12 +294,14 @@
// System.out.println("endElement:"+localname);
}
+ @Override
public void characters(char[] ch, int start, int length) throws SAXException {
if(redirect!=null)
redirect.characters(ch,start,length);
else
text.append(ch,start,length);
}
+ @Override
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {
if(redirect!=null)
redirect.ignorableWhitespace(ch,start,length);
@@ -319,7 +325,8 @@
}
- public void startPrefixMapping( String prefix, String uri ) throws SAXException {
+ @Override
+ public void startPrefixMapping(String prefix, String uri ) throws SAXException {
if(redirect!=null)
redirect.startPrefixMapping(prefix,uri);
else {
@@ -328,7 +335,8 @@
}
}
- public void endPrefixMapping( String prefix ) throws SAXException {
+ @Override
+ public void endPrefixMapping(String prefix ) throws SAXException {
if(redirect!=null)
redirect.endPrefixMapping(prefix);
else {
@@ -337,12 +345,14 @@
}
}
- public void skippedEntity( String name ) throws SAXException {
+ @Override
+ public void skippedEntity(String name ) throws SAXException {
if(redirect!=null)
redirect.skippedEntity(name);
}
- public void processingInstruction( String target, String data ) throws SAXException {
+ @Override
+ public void processingInstruction(String target, String data ) throws SAXException {
if(redirect!=null)
redirect.processingInstruction(target,data);
}
@@ -350,6 +360,7 @@
/** Impossible token. This value can never be a valid XML name. */
static final String IMPOSSIBLE = "\u0000";
+ @Override
public void endDocument() throws SAXException {
// consume the special "end document" token so that all the handlers
// currently at the stack will revert to their respective parents.
@@ -369,6 +380,7 @@
reset();
}
+ @Override
public void startDocument() {}
@@ -380,30 +392,35 @@
//
//
- public void sendEnterAttribute( int threadId,
- String uri, String local, String qname) throws SAXException {
+ @Override
+ public void sendEnterAttribute(int threadId,
+ String uri, String local, String qname) throws SAXException {
currentHandler.enterAttribute(uri,local,qname);
}
- public void sendEnterElement( int threadId,
- String uri, String local, String qname, Attributes atts) throws SAXException {
+ @Override
+ public void sendEnterElement(int threadId,
+ String uri, String local, String qname, Attributes atts) throws SAXException {
currentHandler.enterElement(uri,local,qname,atts);
}
- public void sendLeaveAttribute( int threadId,
- String uri, String local, String qname) throws SAXException {
+ @Override
+ public void sendLeaveAttribute(int threadId,
+ String uri, String local, String qname) throws SAXException {
currentHandler.leaveAttribute(uri,local,qname);
}
- public void sendLeaveElement( int threadId,
- String uri, String local, String qname) throws SAXException {
+ @Override
+ public void sendLeaveElement(int threadId,
+ String uri, String local, String qname) throws SAXException {
currentHandler.leaveElement(uri,local,qname);
}
+ @Override
public void sendText(int threadId, String value) throws SAXException {
currentHandler.text(value);
}
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/Schema.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/Schema.java
index 2a59790..5e0ba20 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/Schema.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/gen/config/Schema.java
@@ -31,6 +31,7 @@
protected String $localName;
protected String $qname;
+ @Override
public final NGCCRuntime getRuntime() {
return($runtime);
}
@@ -50,6 +51,7 @@
location = new File(baseDir,loc);
}
+ @Override
public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
int $ai;
$uri = $__uri;
@@ -104,6 +106,7 @@
}
}
+ @Override
public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
int $ai;
$uri = $__uri;
@@ -158,6 +161,7 @@
}
}
+ @Override
public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
int $ai;
$uri = $__uri;
@@ -199,6 +203,7 @@
}
}
+ @Override
public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
int $ai;
$uri = $__uri;
@@ -250,6 +255,7 @@
}
}
+ @Override
public void text(String $value) throws SAXException {
int $ai;
switch($_ngcc_current_state) {
@@ -298,6 +304,7 @@
}
}
+ @Override
public void onChildCompleted(Object result, int cookie, boolean needAttCheck)throws SAXException {
switch(cookie) {
}
diff --git a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/model/nav/ApNavigator.java b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/model/nav/ApNavigator.java
index 913728a..5299931 100644
--- a/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/model/nav/ApNavigator.java
+++ b/jaxb-ri/jxc/src/main/java/com/sun/tools/jxc/model/nav/ApNavigator.java
@@ -60,6 +60,7 @@
this.primitiveByte = env.getTypeUtils().getPrimitiveType(TypeKind.BYTE);
}
+ @Override
public TypeElement getSuperClass(TypeElement typeElement) {
if (typeElement.getKind().equals(ElementKind.CLASS)) {
TypeMirror sup = typeElement.getSuperclass();
@@ -71,26 +72,32 @@
return env.getElementUtils().getTypeElement(Object.class.getName());
}
+ @Override
public TypeMirror getBaseClass(TypeMirror type, TypeElement sup) {
return baseClassFinder.visit(type, sup);
}
+ @Override
public String getClassName(TypeElement t) {
return t.getQualifiedName().toString();
}
+ @Override
public String getTypeName(TypeMirror typeMirror) {
return typeMirror.toString();
}
+ @Override
public String getClassShortName(TypeElement t) {
return t.getSimpleName().toString();
}
+ @Override
public Collection<VariableElement> getDeclaredFields(TypeElement typeElement) {
return ElementFilter.fieldsIn(typeElement.getEnclosedElements());
}
+ @Override
public VariableElement getDeclaredField(TypeElement clazz, String fieldName) {
for (VariableElement fd : ElementFilter.fieldsIn(clazz.getEnclosedElements())) {
if (fd.getSimpleName().toString().equals(fieldName))
@@ -99,34 +106,42 @@
return null;
}
+ @Override
public Collection<ExecutableElement> getDeclaredMethods(TypeElement typeElement) {
return ElementFilter.methodsIn(typeElement.getEnclosedElements());
}
+ @Override
public TypeElement getDeclaringClassForField(VariableElement f) {
return (TypeElement) f.getEnclosingElement();
}
+ @Override
public TypeElement getDeclaringClassForMethod(ExecutableElement m) {
return (TypeElement) m.getEnclosingElement();
}
+ @Override
public TypeMirror getFieldType(VariableElement f) {
return f.asType();
}
+ @Override
public String getFieldName(VariableElement f) {
return f.getSimpleName().toString();
}
+ @Override
public String getMethodName(ExecutableElement m) {
return m.getSimpleName().toString();
}
+ @Override
public TypeMirror getReturnType(ExecutableElement m) {
return m.getReturnType();
}
+ @Override
public TypeMirror[] getMethodParameters(ExecutableElement m) {
Collection<? extends VariableElement> ps = m.getParameters();
TypeMirror[] r = new TypeMirror[ps.size()];
@@ -136,10 +151,12 @@
return r;
}
+ @Override
public boolean isStaticMethod(ExecutableElement m) {
return hasModifier(m, Modifier.STATIC);
}
+ @Override
public boolean isFinalMethod(ExecutableElement m) {
return hasModifier(m, Modifier.FINAL);
}
@@ -148,6 +165,7 @@
return d.getModifiers().contains(mod);
}
+ @Override
public boolean isSubClassOf(TypeMirror sub, TypeMirror sup) {
if(sup==DUMMY)
// see ref(). if the sub type is known to Annotation Processing,
@@ -157,7 +175,7 @@
return env.getTypeUtils().isSubtype(sub,sup);
}
- private String getSourceClassName(Class clazz) {
+ private String getSourceClassName(Class<?> clazz) {
Class<?> d = clazz.getDeclaringClass();
if(d==null)
return clazz.getName();
@@ -167,7 +185,8 @@
}
}
- public TypeMirror ref(Class c) {
+ @Override
+ public TypeMirror ref(Class<?> c) {
if(c.isArray())
return env.getTypeUtils().getArrayType( ref(c.getComponentType()) );
if(c.isPrimitive())
@@ -186,11 +205,13 @@
return env.getTypeUtils().getDeclaredType(t);
}
+ @Override
public TypeMirror use(TypeElement t) {
assert t != null;
return env.getTypeUtils().getDeclaredType(t);
}
+ @Override
public TypeElement asDecl(TypeMirror m) {
m = env.getTypeUtils().erasure(m);
if (m.getKind().equals(TypeKind.DECLARED)) {
@@ -200,10 +221,12 @@
return null;
}
- public TypeElement asDecl(Class c) {
+ @Override
+ public TypeElement asDecl(Class<?> c) {
return env.getElementUtils().getTypeElement(getSourceClassName(c));
}
+ @Override
public TypeMirror erasure(TypeMirror t) {
Types tu = env.getTypeUtils();
t = tu.erasure(t);
@@ -218,14 +241,17 @@
return t;
}
+ @Override
public boolean isAbstract(TypeElement clazz) {
return hasModifier(clazz,Modifier.ABSTRACT);
}
+ @Override
public boolean isFinal(TypeElement clazz) {
return hasModifier(clazz, Modifier.FINAL);
}
+ @Override
public VariableElement[] getEnumConstants(TypeElement clazz) {
List<? extends Element> elements = env.getElementUtils().getAllMembers(clazz);
Collection<VariableElement> constants = new ArrayList<VariableElement>();
@@ -237,10 +263,12 @@
return constants.toArray(new VariableElement[constants.size()]);
}
+ @Override
public TypeMirror getVoidType() {
return env.getTypeUtils().getNoType(TypeKind.VOID);
}
+ @Override
public String getPackageName(TypeElement clazz) {
return env.getElementUtils().getPackageOf(clazz).getQualifiedName().toString();
}
@@ -250,10 +278,12 @@
return env.getElementUtils().getTypeElement(packageName + ".ObjectFactory");
}
+ @Override
public boolean isBridgeMethod(ExecutableElement method) {
return method.getModifiers().contains(Modifier.VOLATILE);
}
+ @Override
public boolean isOverriding(ExecutableElement method, TypeElement base) {
Elements elements = env.getElementUtils();
@@ -269,14 +299,17 @@
}
}
+ @Override
public boolean isInterface(TypeElement clazz) {
return clazz.getKind().isInterface();
}
+ @Override
public boolean isTransient(VariableElement f) {
return f.getModifiers().contains(Modifier.TRANSIENT);
}
+ @Override
public boolean isInnerClass(TypeElement clazz) {
return clazz.getEnclosingElement() != null && !clazz.getModifiers().contains(Modifier.STATIC);
}
@@ -286,10 +319,12 @@
return env.getTypeUtils().isSameType(t1, t2);
}
+ @Override
public boolean isArray(TypeMirror type) {
return type != null && type.getKind().equals(TypeKind.ARRAY);
}
+ @Override
public boolean isArrayButNotByteArray(TypeMirror t) {
if(!isArray(t))
return false;
@@ -300,6 +335,7 @@
return !ct.equals(primitiveByte);
}
+ @Override
public TypeMirror getComponentType(TypeMirror t) {
if (isArray(t)) {
ArrayType at = (ArrayType) t;
@@ -309,6 +345,7 @@
throw new IllegalArgumentException();
}
+ @Override
public TypeMirror getTypeArgument(TypeMirror typeMirror, int i) {
if (typeMirror != null && typeMirror.getKind().equals(TypeKind.DECLARED)) {
DeclaredType declaredType = (DeclaredType) typeMirror;
@@ -317,6 +354,7 @@
} else throw new IllegalArgumentException();
}
+ @Override
public boolean isParameterizedType(TypeMirror typeMirror) {
if (typeMirror != null && typeMirror.getKind().equals(TypeKind.DECLARED)) {
DeclaredType d = (DeclaredType) typeMirror;
@@ -325,6 +363,7 @@
return false;
}
+ @Override
public boolean isPrimitive(TypeMirror t) {
return t.getKind().isPrimitive();
}
@@ -342,7 +381,8 @@
primitives.put(Character.TYPE, TypeKind.CHAR);
}
- public TypeMirror getPrimitive(Class primitiveType) {
+ @Override
+ public TypeMirror getPrimitive(Class<?> primitiveType) {
assert primitiveType.isPrimitive();
if(primitiveType==void.class)
return getVoidType();
@@ -364,34 +404,41 @@
}
// @Override
+ @Override
public List<? extends AnnotationMirror> getAnnotationMirrors() {
throw new IllegalStateException();
}
// @Override
+ @Override
public <A extends Annotation> A getAnnotation(Class<A> annotationType) {
throw new IllegalStateException();
}
// @Override
+ @Override
public <A extends Annotation> A[] getAnnotationsByType(Class<A> annotationType) {
throw new IllegalStateException();
}
};
+ @Override
public Location getClassLocation(TypeElement typeElement) {
Trees trees = Trees.instance(env);
return getLocation(typeElement.getQualifiedName().toString(), trees.getPath(typeElement));
}
+ @Override
public Location getFieldLocation(VariableElement variableElement) {
return getLocation(variableElement);
}
+ @Override
public Location getMethodLocation(ExecutableElement executableElement) {
return getLocation(executableElement);
}
+ @Override
public boolean hasDefaultConstructor(TypeElement t) {
if (t == null || !t.getKind().equals(ElementKind.CLASS))
return false;
@@ -403,18 +450,22 @@
return false;
}
+ @Override
public boolean isStaticField(VariableElement f) {
return hasModifier(f,Modifier.STATIC);
}
+ @Override
public boolean isPublicMethod(ExecutableElement m) {
return hasModifier(m,Modifier.PUBLIC);
}
+ @Override
public boolean isPublicField(VariableElement f) {
return hasModifier(f,Modifier.PUBLIC);
}
+ @Override
public boolean isEnum(TypeElement t) {
return t != null && t.getKind().equals(ElementKind.ENUM);
}
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/PropertyInfoImpl.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/PropertyInfoImpl.java
index da84bc4..b0a580a 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/PropertyInfoImpl.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/PropertyInfoImpl.java
@@ -34,7 +34,7 @@
* @author Kohsuke Kawaguchi
*/
abstract class PropertyInfoImpl<T,C,F,M>
- implements PropertyInfo<T,C>, Locatable, Comparable<PropertyInfoImpl> /*by their names*/ {
+ implements PropertyInfo<T,C>, Locatable, Comparable<PropertyInfoImpl<T,C,F,M>> /*by their names*/ {
/**
* Object that reads annotations.
@@ -357,7 +357,7 @@
}
@Override
- public int compareTo(PropertyInfoImpl that) {
+ public int compareTo(PropertyInfoImpl<T,C,F,M> that) {
return this.getName().compareTo(that.getName());
}
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/ReferencePropertyInfoImpl.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/ReferencePropertyInfoImpl.java
index 5d51759..a0a1832 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/ReferencePropertyInfoImpl.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/ReferencePropertyInfoImpl.java
@@ -123,21 +123,21 @@
final C je = nav.asDecl(JAXBElement.class);
for( XmlElementRef r : ann ) {
- boolean yield;
+ boolean _yield;
T type = reader.getClassValue(r,"type");
if(nav().isSameType(type, defaultType))
type = nav.erasure(getIndividualType());
if(nav.getBaseClass(type,je)!=null)
- yield = addGenericElement(r);
+ _yield = addGenericElement(r);
else
- yield = addAllSubtypes(type);
+ _yield = addAllSubtypes(type);
// essentially "isRequired &= isRequired(r)" except that we'd like to skip evaluating isRequird(r)
// if the value is already false.
if(isRequired && !isRequired(r))
isRequired = false;
- if(last && !yield) {
+ if(last && !_yield) {
// a reference didn't produce any type.
// diagnose the problem
if(nav().isSameType(type, nav.ref(JAXBElement.class))) {
@@ -162,7 +162,7 @@
}
for (ReferencePropertyInfoImpl<T, C, F, M> info : subTypes) {
- PropertySeed sd = info.seed;
+ PropertySeed<T, C, F, M> sd = info.seed;
refs = sd.readAnnotation(XmlElementRefs.class);
ref = sd.readAnnotation(XmlElementRef.class);
@@ -192,19 +192,19 @@
final C je = nav.asDecl(JAXBElement.class);
for( XmlElementRef r : ann ) {
- boolean yield;
+ boolean _yield;
T type = reader.getClassValue(r,"type");
if (nav().isSameType(type, defaultType)) {
type = nav.erasure(getIndividualType());
}
if (nav.getBaseClass(type,je) != null) {
- yield = addGenericElement(r, info);
+ _yield = addGenericElement(r, info);
} else {
- yield = addAllSubtypes(type);
+ _yield = addAllSubtypes(type);
}
- if(last && !yield) {
+ if(last && !_yield) {
// a reference didn't produce any type.
// diagnose the problem
if(nav().isSameType(type, nav.ref(JAXBElement.class))) {
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java
index 6f30472..a150551 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/RuntimeBuiltinLeafInfoImpl.java
@@ -37,6 +37,7 @@
import javax.imageio.ImageIO;
import javax.imageio.ImageWriter;
import javax.imageio.stream.ImageOutputStream;
+import javax.xml.XMLConstants;
import javax.xml.datatype.DatatypeConstants;
import javax.xml.datatype.Duration;
import javax.xml.datatype.XMLGregorianCalendar;
@@ -158,7 +159,7 @@
public static final Map<Type,RuntimeBuiltinLeafInfoImpl<?>> LEAVES = new HashMap<Type, RuntimeBuiltinLeafInfoImpl<?>>();
private static QName createXS(String typeName) {
- return new QName(WellKnownNamespace.XML_SCHEMA,typeName);
+ return new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI,typeName);
}
public static final RuntimeBuiltinLeafInfoImpl<String> STRING;
@@ -276,7 +277,7 @@
QName type = xs.getSchemaType();
GregorianCalendar cal = new GregorianCalendar(0,0,0);
cal.setTime(v);
- if ((type != null) && (WellKnownNamespace.XML_SCHEMA.equals(type.getNamespaceURI())) &&
+ if ((type != null) && (XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(type.getNamespaceURI())) &&
DATE.equals(type.getLocalPart())) {
return DatatypeConverterImpl._printDate(cal);
} else {
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/RuntimeClassInfoImpl.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/RuntimeClassInfoImpl.java
index f224cea..2503e87 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/RuntimeClassInfoImpl.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/RuntimeClassInfoImpl.java
@@ -41,10 +41,7 @@
import javax.xml.stream.XMLStreamException;
import java.io.IOException;
import java.lang.annotation.Annotation;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.lang.reflect.Type;
+import java.lang.reflect.*;
import java.util.List;
import java.util.Map;
@@ -83,8 +80,8 @@
factoryAnn = findXmlAccessorFactoryAnnotation(clazz);
if (factoryAnn != null) {
try {
- accFactory = factoryAnn.value().newInstance();
- } catch (InstantiationException e) {
+ accFactory = factoryAnn.value().getConstructor().newInstance();
+ } catch (InstantiationException | NoSuchMethodException | InvocationTargetException e) {
builder.reportError(new IllegalAnnotationException(
Messages.ACCESSORFACTORY_INSTANTIATION_EXCEPTION.format(
factoryAnn.getClass().getName(), nav().getClassName(clazz)), this));
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/RuntimeModelBuilder.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/RuntimeModelBuilder.java
index 3c70370..f9ee8e8 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/RuntimeModelBuilder.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/RuntimeModelBuilder.java
@@ -27,6 +27,7 @@
import jakarta.activation.MimeType;
import org.xml.sax.SAXException;
+import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
@@ -133,7 +134,7 @@
}
private static QName createXSSimpleType() {
- return new QName(WellKnownNamespace.XML_SCHEMA,"anySimpleType");
+ return new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI,"anySimpleType");
}
/**
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/SecureLoader.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/SecureLoader.java
index afbf6a4..4ebdfeb 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/SecureLoader.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/model/impl/SecureLoader.java
@@ -24,6 +24,7 @@
} else {
return (ClassLoader) java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction() {
+ @Override
public java.lang.Object run() {
return Thread.currentThread().getContextClassLoader();
}
@@ -37,6 +38,7 @@
} else {
return (ClassLoader) java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction() {
+ @Override
public java.lang.Object run() {
return c.getClassLoader();
}
@@ -50,6 +52,7 @@
} else {
return (ClassLoader) java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction() {
+ @Override
public java.lang.Object run() {
return ClassLoader.getSystemClassLoader();
}
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/AnyTypeBeanInfo.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/AnyTypeBeanInfo.java
index bbda9b5..8c0337e 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/AnyTypeBeanInfo.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/AnyTypeBeanInfo.java
@@ -22,6 +22,7 @@
import org.w3c.dom.*;
import org.xml.sax.SAXException;
+import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
import java.io.IOException;
@@ -36,7 +37,7 @@
private boolean nilIncluded = false;
public AnyTypeBeanInfo(JAXBContextImpl grammar, RuntimeTypeInfo anyTypeInfo) {
- super(grammar, anyTypeInfo, Object.class, new QName(WellKnownNamespace.XML_SCHEMA,"anyType"), false, true, false);
+ super(grammar, anyTypeInfo, Object.class, new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI,"anyType"), false, true, false);
}
@Override
@@ -102,7 +103,7 @@
String local = a.getLocalName();
String name = a.getName();
if(local==null) local = name;
- if (uri.equals(WellKnownNamespace.XML_SCHEMA_INSTANCE) && ("nil".equals(local))) {
+ if (XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI.equals(uri) && ("nil".equals(local))) {
isNilIncluded = true;
}
if(name.startsWith("xmlns")) continue;// DOM reports ns decls as attributes
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/ClassBeanInfoImpl.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/ClassBeanInfoImpl.java
index 33b4377..6e6dcf3 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/ClassBeanInfoImpl.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/ClassBeanInfoImpl.java
@@ -32,6 +32,7 @@
import org.xml.sax.SAXException;
import org.xml.sax.helpers.LocatorImpl;
+import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
import java.io.IOException;
@@ -357,7 +358,7 @@
} else {
p.serializeAttributes(bean,target);
}
- if (p.attName.equals(WellKnownNamespace.XML_SCHEMA_INSTANCE, "nil")) {
+ if (p.attName.equals(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI, "nil")) {
isNilIncluded = true;
}
} catch (AccessorException e) {
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/XMLSerializer.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/XMLSerializer.java
index 41dd77a..1e8f991 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/XMLSerializer.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/XMLSerializer.java
@@ -35,6 +35,7 @@
import jakarta.xml.bind.helpers.ValidationEventLocatorImpl;
import org.xml.sax.SAXException;
+import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
import javax.xml.transform.Source;
@@ -260,7 +261,7 @@
if(!seenRoot) {
seenRoot = true;
if(schemaLocation!=null || noNsSchemaLocation!=null) {
- int p = nsContext.getPrefixIndex(WellKnownNamespace.XML_SCHEMA_INSTANCE);
+ int p = nsContext.getPrefixIndex(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI);
if(schemaLocation!=null)
out.attribute(p,"schemaLocation",schemaLocation);
if(noNsSchemaLocation!=null)
@@ -634,7 +635,7 @@
getCurrentLocation(fieldName)));
// recover by not printing @xsi:type
} else {
- getNamespaceContext().declareNamespace(WellKnownNamespace.XML_SCHEMA_INSTANCE,"xsi",true);
+ getNamespaceContext().declareNamespace(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI,"xsi",true);
getNamespaceContext().declareNamespace(actualTypeName.getNamespaceURI(),null,false);
}
}
@@ -642,19 +643,19 @@
actual.serializeURIs(child,this);
if (nillable) {
- getNamespaceContext().declareNamespace(WellKnownNamespace.XML_SCHEMA_INSTANCE,"xsi",true);
+ getNamespaceContext().declareNamespace(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI,"xsi",true);
}
endNamespaceDecls(child);
if(!asExpected) {
- attribute(WellKnownNamespace.XML_SCHEMA_INSTANCE,"type",
+ attribute(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI,"type",
DatatypeConverter.printQName(actualTypeName,getNamespaceContext()));
}
actual.serializeAttributes(child,this);
boolean nilDefined = actual.isNilIncluded();
if ((nillable) && (!nilDefined)) {
- attribute(WellKnownNamespace.XML_SCHEMA_INSTANCE,"nil","true");
+ attribute(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI,"nil","true");
}
endAttributes();
@@ -756,9 +757,9 @@
* </pre>
*/
public final void writeXsiNilTrue() throws SAXException, IOException, XMLStreamException {
- getNamespaceContext().declareNamespace(WellKnownNamespace.XML_SCHEMA_INSTANCE,"xsi",true);
+ getNamespaceContext().declareNamespace(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI,"xsi",true);
endNamespaceDecls(null);
- attribute(WellKnownNamespace.XML_SCHEMA_INSTANCE,"nil","true");
+ attribute(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI,"nil","true");
endAttributes();
}
@@ -898,7 +899,7 @@
}
if(schemaLocation!=null || noNsSchemaLocation!=null) {
- nsContext.declareNsUri(WellKnownNamespace.XML_SCHEMA_INSTANCE,"xsi",true);
+ nsContext.declareNsUri(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI,"xsi",true);
}
}
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/output/NamespaceContextImpl.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/output/NamespaceContextImpl.java
index 6ac4796..5fe03eb 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/output/NamespaceContextImpl.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/output/NamespaceContextImpl.java
@@ -536,9 +536,9 @@
private static final NamespacePrefixMapper defaultNamespacePrefixMapper = new NamespacePrefixMapper() {
@Override
public String getPreferredPrefix(String namespaceUri, String suggestion, boolean requirePrefix) {
- if( namespaceUri.equals(WellKnownNamespace.XML_SCHEMA_INSTANCE) )
+ if( XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI.equals(namespaceUri) )
return "xsi";
- if( namespaceUri.equals(WellKnownNamespace.XML_SCHEMA) )
+ if( XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(namespaceUri) )
return "xs";
if( namespaceUri.equals(WellKnownNamespace.XML_MIME_URI) )
return "xmime";
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/output/SecureLoader.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/output/SecureLoader.java
index 6d6611f..19c71cc 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/output/SecureLoader.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/output/SecureLoader.java
@@ -24,6 +24,7 @@
} else {
return (ClassLoader) java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction() {
+ @Override
public java.lang.Object run() {
return Thread.currentThread().getContextClassLoader();
}
@@ -37,6 +38,7 @@
} else {
return (ClassLoader) java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction() {
+ @Override
public java.lang.Object run() {
return c.getClassLoader();
}
@@ -50,6 +52,7 @@
} else {
return (ClassLoader) java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction() {
+ @Override
public java.lang.Object run() {
return ClassLoader.getSystemClassLoader();
}
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/reflect/Accessor.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/reflect/Accessor.java
index 0ae6951..6573f79 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/reflect/Accessor.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/reflect/Accessor.java
@@ -34,12 +34,10 @@
/**
* Accesses a particular property of a bean.
* <p>
- * <p>
* This interface encapsulates the access to the actual data store.
* The intention is to generate implementations for a particular bean
* and a property to improve the performance.
* <p>
- * <p>
* Accessor can be used as a receiver. Upon receiving an object
* it sets that to the field.
*
@@ -359,7 +357,6 @@
/**
* A version of {@link GetterSetterReflection} that doesn't have any setter.
* <p>
- * <p>
* This provides a user-friendly error message.
*/
public static class GetterOnlyReflection<BeanT, ValueT> extends GetterSetterReflection<BeanT, ValueT> {
@@ -376,7 +373,6 @@
/**
* A version of {@link GetterSetterReflection} thaat doesn't have any getter.
* <p>
- * <p>
* This provides a user-friendly error message.
*/
public static class SetterOnlyReflection<BeanT, ValueT> extends GetterSetterReflection<BeanT, ValueT> {
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/reflect/opt/SecureLoader.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/reflect/opt/SecureLoader.java
index 6428ff1..2242036 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/reflect/opt/SecureLoader.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/reflect/opt/SecureLoader.java
@@ -24,6 +24,7 @@
} else {
return (ClassLoader) java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction() {
+ @Override
public java.lang.Object run() {
return Thread.currentThread().getContextClassLoader();
}
@@ -37,6 +38,7 @@
} else {
return (ClassLoader) java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction() {
+ @Override
public java.lang.Object run() {
return c.getClassLoader();
}
@@ -50,6 +52,7 @@
} else {
return (ClassLoader) java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction() {
+ @Override
public java.lang.Object run() {
return ClassLoader.getSystemClassLoader();
}
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/LeafPropertyXsiLoader.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/LeafPropertyXsiLoader.java
index 40abaed..7e88077 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/LeafPropertyXsiLoader.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/LeafPropertyXsiLoader.java
@@ -19,6 +19,7 @@
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
+import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
import java.util.Collection;
@@ -50,7 +51,7 @@
// look for @xsi:type
Attributes atts = ea.atts;
- int idx = atts.getIndex(WellKnownNamespace.XML_SCHEMA_INSTANCE, "type");
+ int idx = atts.getIndex(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI, "type");
if (idx >= 0) {
String value = atts.getValue(idx);
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/SecureLoader.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/SecureLoader.java
index 71da93d..ed48a57 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/SecureLoader.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/SecureLoader.java
@@ -24,6 +24,7 @@
} else {
return (ClassLoader) java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction() {
+ @Override
public java.lang.Object run() {
return Thread.currentThread().getContextClassLoader();
}
@@ -37,6 +38,7 @@
} else {
return (ClassLoader) java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction() {
+ @Override
public java.lang.Object run() {
return c.getClassLoader();
}
@@ -50,6 +52,7 @@
} else {
return (ClassLoader) java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction() {
+ @Override
public java.lang.Object run() {
return ClassLoader.getSystemClassLoader();
}
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/StructureLoader.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/StructureLoader.java
index c05c170..2ed1ca2 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/StructureLoader.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/StructureLoader.java
@@ -27,6 +27,7 @@
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
+import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
import java.util.Collection;
import java.util.HashMap;
@@ -180,7 +181,7 @@
xacc.parse(child,avalue);
} else if (attCatchAll!=null) {
String qname = atts.getQName(i);
- if(atts.getURI(i).equals(WellKnownNamespace.XML_SCHEMA_INSTANCE))
+ if(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI.equals(atts.getURI(i)))
continue; // xsi:* attributes are meant to be processed by us, not by user apps.
Object o = state.getTarget();
Map<QName,String> map = attCatchAll.get(o);
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/XsiNilLoader.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/XsiNilLoader.java
index 490ba96..cc6e195 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/XsiNilLoader.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/XsiNilLoader.java
@@ -17,6 +17,7 @@
import jakarta.xml.bind.JAXBElement;
import org.xml.sax.SAXException;
+import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
import java.util.Collection;
@@ -37,7 +38,7 @@
@Override
protected Loader selectLoader(UnmarshallingContext.State state, TagName ea) throws SAXException {
- int idx = ea.atts.getIndex(WellKnownNamespace.XML_SCHEMA_INSTANCE,"nil");
+ int idx = ea.atts.getIndex(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI,"nil");
if (idx!=-1) {
Boolean b = DatatypeConverterImpl._parseBoolean(ea.atts.getValue(idx));
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/XsiTypeLoader.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/XsiTypeLoader.java
index a77b4fa..e11c331 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/XsiTypeLoader.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/runtime/unmarshaller/XsiTypeLoader.java
@@ -17,6 +17,7 @@
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
+import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
import java.util.Collection;
import java.util.Collections;
@@ -100,7 +101,7 @@
return beanInfo;
}
- static final QName XsiTypeQNAME = new QName(WellKnownNamespace.XML_SCHEMA_INSTANCE,"type");
+ static final QName XsiTypeQNAME = new QName(XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI,"type");
@Override
public Collection<QName> getExpectedAttributes() {
diff --git a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/schemagen/XmlSchemaGenerator.java b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/schemagen/XmlSchemaGenerator.java
index 7eca34c..e68ba06 100644
--- a/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/schemagen/XmlSchemaGenerator.java
+++ b/jaxb-ri/runtime/impl/src/main/java/org/glassfish/jaxb/runtime/v2/schemagen/XmlSchemaGenerator.java
@@ -36,6 +36,7 @@
import org.glassfish.jaxb.runtime.v2.schemagen.xmlschema.*;
import org.xml.sax.SAXParseException;
+import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
import javax.xml.transform.Result;
import javax.xml.transform.stream.StreamResult;
@@ -49,7 +50,6 @@
import java.util.logging.Level;
import java.util.logging.Logger;
-import static org.glassfish.jaxb.core.v2.WellKnownNamespace.XML_SCHEMA;
import static org.glassfish.jaxb.runtime.v2.schemagen.Util.*;
/**
@@ -390,7 +390,7 @@
// we create a Namespace object for the XML Schema namespace
// as a side-effect, but we don't want to generate it.
- namespaces.remove(WellKnownNamespace.XML_SCHEMA);
+ namespaces.remove(XMLConstants.W3C_XML_SCHEMA_NS_URI);
// first create the outputs for all so that we can resolve references among
// schema files when we write
@@ -537,7 +537,7 @@
String nsUri = qname.getNamespaceURI();
- if (nsUri.equals(XML_SCHEMA)) {
+ if (XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(nsUri)) {
// no need to explicitly refer to XSD namespace
return;
}
@@ -584,9 +584,9 @@
// declare XML Schema namespace to be xs, but allow the user to override it.
// if 'xs' is used for other things, we'll just let TXW assign a random prefix
- if(!xmlNs.containsValue(WellKnownNamespace.XML_SCHEMA)
+ if(!xmlNs.containsValue(XMLConstants.W3C_XML_SCHEMA_NS_URI)
&& !xmlNs.containsKey("xs"))
- schema._namespace(WellKnownNamespace.XML_SCHEMA,"xs");
+ schema._namespace(XMLConstants.W3C_XML_SCHEMA_NS_URI,"xs");
schema.version("1.0");
if(uri.length()!=0)
@@ -685,10 +685,10 @@
// ID / IDREF handling
switch(typeRef.getSource().id()) {
case ID:
- th._attribute(refAttName, new QName(WellKnownNamespace.XML_SCHEMA, "ID"));
+ th._attribute(refAttName, new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI, "ID"));
return;
case IDREF:
- th._attribute(refAttName, new QName(WellKnownNamespace.XML_SCHEMA, "IDREF"));
+ th._attribute(refAttName, new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI, "IDREF"));
return;
case NONE:
// no ID/IDREF, so continue on and generate the type
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/AntErrorListener.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/AntErrorListener.java
index 8127970..1c9947e 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/AntErrorListener.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/AntErrorListener.java
@@ -25,14 +25,17 @@
this.project = p;
}
+ @Override
public void error(SAXParseException e) {
print(e,Project.MSG_ERR);
}
+ @Override
public void fatalError(SAXParseException e) {
print(e,Project.MSG_ERR);
}
+ @Override
public void warning(SAXParseException e) {
print(e,Project.MSG_WARN);
}
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/ConsoleErrorReporter.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/ConsoleErrorReporter.java
index 298507a..cc21aea 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/ConsoleErrorReporter.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/ConsoleErrorReporter.java
@@ -27,16 +27,19 @@
this.out = out;
}
+ @Override
public void error(SAXParseException exception) {
out.print("[ERROR] ");
print(exception);
}
+ @Override
public void fatalError(SAXParseException exception) {
out.print("[FATAL] ");
print(exception);
}
+ @Override
public void warning(SAXParseException exception) {
out.print("[WARNING] ");
print(exception);
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/ErrorListener.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/ErrorListener.java
index 4509128..3926d07 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/ErrorListener.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/ErrorListener.java
@@ -19,8 +19,11 @@
* @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
*/
public interface ErrorListener extends ErrorHandler {
+ @Override
abstract void error (SAXParseException exception);
+ @Override
abstract void fatalError (SAXParseException exception);
+ @Override
abstract void warning (SAXParseException exception);
}
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/NameUtil.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/NameUtil.java
index 26be0c1..7f9d094 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/NameUtil.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/NameUtil.java
@@ -19,6 +19,12 @@
*/
public class NameUtil {
+ /**
+ * Default constructor.
+ */
+ private NameUtil() {
+ }
+
protected static boolean isPunct(char c) {
return (c == '-' || c == '.' || c == ':' || c == '_' || c == '\u00b7'
|| c == '\u0387' || c == '\u06dd' || c == '\u06de');
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/RELAXNGLoader.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/RELAXNGLoader.java
index c09a74d..1d1184f 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/RELAXNGLoader.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/RELAXNGLoader.java
@@ -45,16 +45,7 @@
import com.sun.tools.rngdatatype.DatatypeLibrary;
import com.sun.tools.rngdatatype.DatatypeLibraryFactory;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.io.UnsupportedEncodingException;
-import java.net.URL;
-import java.util.Enumeration;
-import java.util.NoSuchElementException;
-import java.util.Vector;
+import java.util.ServiceLoader;
/**
* @author Kohsuke Kawaguchi
@@ -66,9 +57,11 @@
this.parseable = parseable;
}
+ @Override
public NodeSet build(TxwOptions options) throws IllegalSchemaException {
SchemaBuilderImpl stage1 = new SchemaBuilderImpl(options.codeModel);
DatatypeLibraryLoader loader = new DatatypeLibraryLoader(getClass().getClassLoader());
+ @SuppressWarnings("unchecked")
Leaf pattern = (Leaf)parseable.parse(new CheckingSchemaBuilder(stage1,options.errorListener,
new CascadingDatatypeLibraryFactory(
new BuiltinDatatypeLibraryFactory(loader),loader)));
@@ -77,17 +70,15 @@
}
private static final class DatatypeLibraryLoader implements DatatypeLibraryFactory {
- private final Service service;
+ private final ServiceLoader<DatatypeLibraryFactory> service;
private DatatypeLibraryLoader(ClassLoader cl) {
- service = new Service(DatatypeLibraryFactory.class,cl);
+ service = ServiceLoader.load(DatatypeLibraryFactory.class, cl);
}
+ @Override
public DatatypeLibrary createDatatypeLibrary(String uri) {
- for (Enumeration e = service.getProviders();
- e.hasMoreElements();) {
- DatatypeLibraryFactory factory
- = (DatatypeLibraryFactory) e.nextElement();
+ for (DatatypeLibraryFactory factory : service) {
DatatypeLibrary library = factory.createDatatypeLibrary(uri);
if (library != null)
return library;
@@ -95,129 +86,5 @@
return null;
}
- private static class Service {
- private final Class serviceClass;
- private /*final*/ Enumeration configFiles;
- private Enumeration classNames = null;
- private final Vector providers = new Vector();
- private ClassLoader cl;
-
- private class ProviderEnumeration implements Enumeration {
- private int nextIndex = 0;
-
- public boolean hasMoreElements() {
- return nextIndex < providers.size() || moreProviders();
- }
-
- public Object nextElement() {
- try {
- return providers.elementAt(nextIndex++);
- } catch (ArrayIndexOutOfBoundsException e) {
- throw new NoSuchElementException();
- }
- }
- }
-
- public Service(Class cls, ClassLoader cl) {
- this.cl = cl;
- serviceClass = cls;
- String resName = "META-INF/services/" + serviceClass.getName();
- try {
- configFiles = cl.getResources(resName);
- } catch (IOException e) {
- configFiles = new Vector().elements();
- }
- }
-
- public Enumeration getProviders() {
- return new ProviderEnumeration();
- }
-
- synchronized private boolean moreProviders() {
- for (; ;) {
- while (classNames == null) {
- if (!configFiles.hasMoreElements())
- return false;
- classNames = parseConfigFile((URL) configFiles.nextElement());
- }
- while (classNames.hasMoreElements()) {
- String className = (String) classNames.nextElement();
- try {
- Class cls = cl.loadClass(className);
- Object obj = cls.newInstance();
- if (serviceClass.isInstance(obj)) {
- providers.addElement(obj);
- return true;
- }
- }
- catch (ClassNotFoundException e) {
- }
- catch (InstantiationException e) {
- }
- catch (IllegalAccessException e) {
- }
- catch (LinkageError e) {
- }
- }
- classNames = null;
- }
- }
-
- private static final int START = 0;
- private static final int IN_NAME = 1;
- private static final int IN_COMMENT = 2;
-
- private static Enumeration parseConfigFile(URL url) {
- try {
- InputStream in = url.openStream();
- Reader r;
- try {
- r = new InputStreamReader(in, "UTF-8");
- }
- catch (UnsupportedEncodingException e) {
- r = new InputStreamReader(in, "UTF8");
- }
- r = new BufferedReader(r);
- Vector tokens = new Vector();
- StringBuffer tokenBuf = new StringBuffer();
- int state = START;
- for (; ;) {
- int n = r.read();
- if (n < 0)
- break;
- char c = (char) n;
- switch (c) {
- case '\r':
- case '\n':
- state = START;
- break;
- case ' ':
- case '\t':
- break;
- case '#':
- state = IN_COMMENT;
- break;
- default:
- if (state != IN_COMMENT) {
- state = IN_NAME;
- tokenBuf.append(c);
- }
- break;
- }
- if (tokenBuf.length() != 0 && state != IN_NAME) {
- tokens.addElement(tokenBuf.toString());
- tokenBuf.setLength(0);
- }
- }
- if (tokenBuf.length() != 0)
- tokens.addElement(tokenBuf.toString());
- return tokens.elements();
- }
- catch (IOException e) {
- return null;
- }
- }
- }
-
}
}
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/TxwTask.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/TxwTask.java
index b3b23b8..81c6825 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/TxwTask.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/TxwTask.java
@@ -106,6 +106,7 @@
/**
* launch txw
*/
+ @Override
public void execute() throws BuildException {
options.errorListener = new AntErrorListener(getProject());
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/XmlSchemaLoader.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/XmlSchemaLoader.java
index f23d752..62d0897 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/XmlSchemaLoader.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/XmlSchemaLoader.java
@@ -26,6 +26,7 @@
this.in = in;
}
+ @Override
public NodeSet build(TxwOptions options) throws SAXException {
XSOMParser xsom = new XSOMParser();
xsom.parse(in);
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/AnnotationsImpl.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/AnnotationsImpl.java
index 06d389c..f064bcb 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/AnnotationsImpl.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/AnnotationsImpl.java
@@ -19,15 +19,19 @@
* @author Kohsuke Kawaguchi
*/
final class AnnotationsImpl implements Annotations<ParsedElementAnnotation,LocatorImpl,CommentListImpl> {
+ @Override
public void addAttribute(String ns, String localName, String prefix, String value, LocatorImpl locator) throws BuildException {
}
+ @Override
public void addElement(ParsedElementAnnotation parsedElementAnnotation) throws BuildException {
}
+ @Override
public void addComment(CommentListImpl commentList) throws BuildException {
}
+ @Override
public void addLeadingComment(CommentListImpl commentList) throws BuildException {
}
}
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/DataPatternBuilderImpl.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/DataPatternBuilderImpl.java
index 2c0fd18..8bc7745 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/DataPatternBuilderImpl.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/DataPatternBuilderImpl.java
@@ -29,16 +29,20 @@
this.type = type;
}
+ @Override
public Leaf makePattern(LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
return new Data(locator,type);
}
+ @Override
public void addParam(String name, String value, Context context, String ns, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
}
+ @Override
public void annotation(ParsedElementAnnotation parsedElementAnnotation) {
}
+ @Override
public Leaf makePattern(Leaf except, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
return makePattern(locator,annotations);
}
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/DivImpl.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/DivImpl.java
index b88b5ea..748eab4 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/DivImpl.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/DivImpl.java
@@ -28,6 +28,7 @@
super(parent,grammar);
}
+ @Override
public void endDiv(LocatorImpl locator, AnnotationsImpl annotations) {
}
}
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/GrammarImpl.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/GrammarImpl.java
index da5eb0c..4ebaa3a 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/GrammarImpl.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/GrammarImpl.java
@@ -28,14 +28,17 @@
super(scope,new com.sun.tools.txw2.model.Grammar());
}
+ @Override
public Leaf endGrammar(LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
return new Ref(locator,grammar,com.sun.tools.txw2.model.Grammar.START);
}
+ @Override
public Leaf makeParentRef(String name, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
return parent.makeRef(name,locator,annotations);
}
+ @Override
public Leaf makeRef(String name, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
return new Ref(locator,grammar,name);
}
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/GrammarSectionImpl.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/GrammarSectionImpl.java
index 76dd512..920e70d 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/GrammarSectionImpl.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/GrammarSectionImpl.java
@@ -37,21 +37,26 @@
this.grammar = grammar;
}
+ @Override
public void topLevelAnnotation(ParsedElementAnnotation parsedElementAnnotation) throws BuildException {
}
+ @Override
public void topLevelComment(CommentListImpl commentList) throws BuildException {
}
+ @Override
public Div<Leaf, ParsedElementAnnotation, LocatorImpl, AnnotationsImpl, CommentListImpl> makeDiv() {
return new DivImpl(parent,grammar);
}
+ @Override
public Include<Leaf, ParsedElementAnnotation, LocatorImpl, AnnotationsImpl, CommentListImpl> makeInclude() {
// TODO
throw new UnsupportedOperationException();
}
+ @Override
public void define(String name, Combine combine, Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
Define def = grammar.get(name);
def.location = locator;
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/SchemaBuilderImpl.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/SchemaBuilderImpl.java
index a71b770..2842798 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/SchemaBuilderImpl.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/relaxng/SchemaBuilderImpl.java
@@ -53,12 +53,14 @@
}
+ @Override
public Leaf expandPattern(Leaf leaf) throws BuildException {
return leaf;
}
+ @Override
public NameClassBuilder getNameClassBuilder() throws BuildException {
return ncb;
}
@@ -69,52 +71,64 @@
return leaves.get(0);
}
+ @Override
public Leaf makeChoice(java.util.List<Leaf> leaves, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
return merge(leaves);
}
+ @Override
public Leaf makeInterleave(java.util.List<Leaf> leaves, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
return merge(leaves);
}
+ @Override
public Leaf makeGroup(java.util.List<Leaf> leaves, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
return merge(leaves);
}
+ @Override
public Leaf makeOneOrMore(Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
return leaf;
}
+ @Override
public Leaf makeZeroOrMore(Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
return leaf.merge(new Empty(locator));
}
+ @Override
public Leaf makeOptional(Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
return leaf.merge(new Empty(locator));
}
+ @Override
public Leaf makeList(Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
return new List(locator,leaf);
}
+ @Override
public Leaf makeMixed(Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
return leaf.merge(new Data(locator,string));
}
+ @Override
public Leaf makeEmpty(LocatorImpl locator, AnnotationsImpl annotations) {
return new Empty(locator);
}
+ @Override
public Leaf makeNotAllowed(LocatorImpl locator, AnnotationsImpl annotations) {
// technically this is incorrect, but we won't be
// able to handle <notAllowed/> correctly anyway.
return new Empty(locator);
}
+ @Override
public Leaf makeText(LocatorImpl locator, AnnotationsImpl annotations) {
return new Data(locator,string);
}
+ @Override
public Leaf makeAttribute(NameClass nameClass, Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
Leaf r = null;
for( QName n : nameClass.listNames() ) {
@@ -126,6 +140,7 @@
return r;
}
+ @Override
public Leaf makeElement(NameClass nameClass, Leaf leaf, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
Leaf r = null;
for( QName n : nameClass.listNames() ) {
@@ -137,6 +152,7 @@
return r;
}
+ @Override
public DataPatternBuilder makeDataPatternBuilder(String datatypeLibrary, String type, LocatorImpl locator) throws BuildException {
return new DataPatternBuilderImpl(getType(datatypeLibrary, type));
}
@@ -147,51 +163,63 @@
return t;
}
+ @Override
public Leaf makeValue(String datatypeLibrary, String type, String value, Context c, String ns, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException {
return new Value(locator,getType(datatypeLibrary, type),value);
}
+ @Override
public Grammar<Leaf,ParsedElementAnnotation,LocatorImpl,AnnotationsImpl,CommentListImpl> makeGrammar(Scope<Leaf,ParsedElementAnnotation,LocatorImpl,AnnotationsImpl,CommentListImpl> scope) {
return new GrammarImpl(scope);
}
+ @Override
public Leaf annotate(Leaf leaf, AnnotationsImpl annotations) throws BuildException {
return leaf;
}
+ @Override
public Leaf annotateAfter(Leaf leaf, ParsedElementAnnotation parsedElementAnnotation) throws BuildException {
return leaf;
}
+ @Override
public Leaf makeErrorPattern() {
return new Empty(null);
}
+ @Override
public boolean usesComments() {
return false;
}
+ @Override
public Leaf makeExternalRef(Parseable current, String uri, String ns, Scope<Leaf,ParsedElementAnnotation,LocatorImpl,AnnotationsImpl,CommentListImpl> scope, LocatorImpl locator, AnnotationsImpl annotations) throws BuildException, IllegalSchemaException {
// I'm not too sure if this is correct
return current.parseExternal(uri, this, scope, ns );
}
+ @Override
public LocatorImpl makeLocation(String systemId, int lineNumber, int columnNumber) {
return new LocatorImpl(systemId,lineNumber,columnNumber);
}
+ @Override
public AnnotationsImpl makeAnnotations(CommentListImpl commentList, Context context) {
return new AnnotationsImpl();
}
+ @Override
public ElementAnnotationBuilder<Leaf, ParsedElementAnnotation, LocatorImpl, AnnotationsImpl, CommentListImpl> makeElementAnnotationBuilder(String ns, String localName, String prefix, LocatorImpl locator, CommentListImpl commentList, Context context) {
return new ElementAnnotationBuilderImpl();
}
+ @Override
public CommentListImpl makeCommentList() {
return null;
}
+ @Override
public Leaf commentAfter(Leaf leaf, CommentListImpl commentList) throws BuildException {
return leaf;
}
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/xsd/XmlSchemaBuilder.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/xsd/XmlSchemaBuilder.java
index 36afd8e..2af91f2 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/xsd/XmlSchemaBuilder.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/builder/xsd/XmlSchemaBuilder.java
@@ -77,34 +77,41 @@
nodeSet.addAll(attGroups.values());
}
+ @Override
public Leaf simpleType(XSSimpleType simpleType) {
return simpleType.apply((XSSimpleTypeFunction<Leaf>)this);
}
+ @Override
public Leaf particle(XSParticle particle) {
return particle.getTerm().apply(this);
}
+ @Override
public Leaf empty(XSContentType empty) {
return new Empty(empty.getLocator());
}
+ @Override
public Attribute attributeDecl(XSAttributeDecl decl) {
return new Attribute(decl.getLocator(),
getQName(decl),
simpleType(decl.getType()));
}
+ @Override
public Attribute attributeUse(XSAttributeUse use) {
return attributeDecl(use.getDecl());
}
+ @Override
public Leaf wildcard(XSWildcard wc) {
// wildcard can be always written through the well-formedness method.
// no need to generate anything for this.
return new Empty(wc.getLocator());
}
+ @Override
public Leaf modelGroupDecl(XSModelGroupDecl mg) {
Define def = modelGroups.get(mg);
if(def==null) {
@@ -116,6 +123,7 @@
return new Ref(mg.getLocator(),def);
}
+ @Override
public Leaf modelGroup(XSModelGroup mg) {
XSParticle[] children = mg.getChildren();
if(children.length==0) return new Empty(mg.getLocator());
@@ -126,12 +134,14 @@
return l;
}
+ @Override
public Leaf elementDecl(XSElementDecl e) {
Element el = new Element(e.getLocator(),getQName(e),e.getType().apply(this));
nodeSet.add(el);
return el;
}
+ @Override
public Leaf complexType(XSComplexType ct) {
Define def = complexTypes.get(ct);
if(def==null) {
@@ -173,6 +183,7 @@
}
}
+ @Override
public Leaf attGroupDecl(XSAttGroupDecl ag) {
Define def = attGroups.get(ag);
if(def==null) {
@@ -187,12 +198,14 @@
return t.getName().equals("anyType") && t.getTargetNamespace().equals("http://www.w3.org/2001/XMLSchema");
}
+ @Override
public Leaf restrictionSimpleType(XSRestrictionSimpleType rst) {
JType t = dtf.getType(rst.getTargetNamespace(),rst.getName());
if(t!=null) return new Data(rst.getLocator(),t);
return simpleType(rst.getSimpleBaseType());
}
+ @Override
public Leaf unionSimpleType(XSUnionSimpleType st) {
Leaf l = simpleType(st.getMember(0));
for( int i=1; i<st.getMemberSize(); i++ )
@@ -200,6 +213,7 @@
return l;
}
+ @Override
public Leaf listSimpleType(XSListSimpleType st) {
return new List(st.getLocator(),simpleType(st.getItemType()));
}
@@ -241,26 +255,32 @@
// won't be used
+ @Override
public Leaf annotation(XSAnnotation xsAnnotation) {
throw new IllegalStateException();
}
+ @Override
public Leaf schema(XSSchema xsSchema) {
throw new IllegalStateException();
}
+ @Override
public Leaf facet(XSFacet xsFacet) {
throw new IllegalStateException();
}
+ @Override
public Leaf notation(XSNotation xsNotation) {
throw new IllegalStateException();
}
+ @Override
public Leaf identityConstraint(XSIdentityConstraint xsIdentityConstraint) {
throw new IllegalStateException();
}
+ @Override
public Leaf xpath(XSXPath xsxPath) {
throw new IllegalStateException();
}
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Attribute.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Attribute.java
index 0aa928d..a953bba 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Attribute.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Attribute.java
@@ -35,14 +35,17 @@
super(location, name, leaf);
}
+ @Override
void declare(NodeSet nset) {
; // attributes won't produce a class
}
+ @Override
void generate(NodeSet nset) {
; // nothing
}
+ @Override
void generate(JDefinedClass clazz, NodeSet nset, Set<Prop> props) {
Set<JType> types = new HashSet<JType>();
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/CycleIterator.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/CycleIterator.java
index 0d6b8ee2..1057a76 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/CycleIterator.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/CycleIterator.java
@@ -26,10 +26,12 @@
this.current = start;
}
+ @Override
public boolean hasNext() {
return hasNext;
}
+ @Override
public Leaf next() {
Leaf last = current;
current = current.getNext();
@@ -39,6 +41,7 @@
return last;
}
+ @Override
public void remove() {
throw new UnsupportedOperationException();
}
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Data.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Data.java
index 1a6cf63..e954dac 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Data.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Data.java
@@ -31,10 +31,12 @@
this.type = type;
}
+ @Override
public JType getDatatype(NodeSet nset) {
return type;
}
+ @Override
void generate(JDefinedClass clazz, NodeSet nset, Set<Prop> props) {
createDataMethod(clazz,type,nset,props);
}
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Define.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Define.java
index a60d7d9..f512283 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Define.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Define.java
@@ -48,6 +48,7 @@
return hasOneChild() || name==Grammar.START;
}
+ @Override
void declare(NodeSet nset) {
if(isInline()) return;
@@ -55,6 +56,7 @@
clazz._implements(TypedXmlWriter.class);
}
+ @Override
void generate(NodeSet nset) {
if(clazz==null) return;
@@ -63,6 +65,7 @@
l.generate(clazz,nset,props);
}
+ @Override
void generate(JDefinedClass clazz, NodeSet nset, Set<Prop> props) {
if(isInline()) {
for( Leaf l : this )
@@ -73,6 +76,7 @@
}
}
+ @Override
void prepare(NodeSet nset) {
if(isInline() && leaf instanceof WriterNode && !name.equals(Grammar.START))
((WriterNode)leaf).alternativeName = name;
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Element.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Element.java
index 2db5100..e17b93b 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Element.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Element.java
@@ -66,15 +66,18 @@
return new DataOnly();
}
+ @Override
void declare(NodeSet nset) {
strategy = decideStrategy();
strategy.declare(nset);
}
+ @Override
void generate(NodeSet nset) {
strategy.generate(nset);
}
+ @Override
void generate(JDefinedClass clazz, NodeSet nset, Set<Prop> props) {
strategy.generate(clazz,nset,props);
}
@@ -111,6 +114,7 @@
private class ToInterface implements Strategy {
private JDefinedClass clazz;
+ @Override
public void declare(NodeSet nset) {
String cname;
if(alternativeName!=null)
@@ -125,12 +129,14 @@
// TODO: namespace
}
+ @Override
public void generate(NodeSet nset) {
HashSet<Prop> props = new HashSet<Prop>();
for( Leaf l : Element.this )
l.generate(clazz,nset, props);
}
+ @Override
public void generate(JDefinedClass outer, NodeSet nset, Set<Prop> props) {
if(props.add(new ElementProp(name,clazz)))
generateMethod(outer, nset, clazz);
@@ -147,11 +153,14 @@
this.ref = ref;
}
+ @Override
public void declare(NodeSet nset) {
}
+ @Override
public void generate(NodeSet nset) {
}
+ @Override
public void generate(JDefinedClass clazz, NodeSet nset, Set<Prop> props) {
if(props.add(new ElementProp(name,ref.def.clazz)))
generateMethod(clazz, nset, ref.def.clazz);
@@ -159,12 +168,15 @@
}
private class DataOnly implements Strategy {
+ @Override
public void declare(NodeSet nset) {
}
+ @Override
public void generate(NodeSet nset) {
}
// TODO: code share with Attribute
+ @Override
public void generate(JDefinedClass clazz, NodeSet nset, Set<Prop> props) {
Set<JType> types = new HashSet<JType>();
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Empty.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Empty.java
index e463074..960d932 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Empty.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Empty.java
@@ -24,6 +24,7 @@
super(location);
}
+ @Override
void generate(JDefinedClass clazz, NodeSet nset, Set<Prop> props) {
// noop
}
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Leaf.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Leaf.java
index e9d6fa9..dafc7b4 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Leaf.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Leaf.java
@@ -77,6 +77,7 @@
*/
public final Iterable<Leaf> siblings() {
return new Iterable<Leaf>() {
+ @Override
public Iterator<Leaf> iterator() {
return new CycleIterator(Leaf.this);
}
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/List.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/List.java
index 19f510b..8c5ec9f 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/List.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/List.java
@@ -27,6 +27,7 @@
super(location, leaf);
}
+ @Override
public JType getDatatype(NodeSet nset) {
if(hasOneChild() && leaf instanceof Text) {
return ((Text)leaf).getDatatype(nset).array();
@@ -35,6 +36,7 @@
}
}
+ @Override
void generate(JDefinedClass clazz, NodeSet nset, Set<Prop> props) {
createDataMethod(clazz,getDatatype(nset),nset,props);
}
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Node.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Node.java
index 9eae78e..df4619e 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Node.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Node.java
@@ -38,6 +38,7 @@
/**
* Iterates all the children.
*/
+ @Override
public final Iterator<Leaf> iterator() {
return new CycleIterator(leaf);
}
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/NodeSet.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/NodeSet.java
index a43d956..d5bab92 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/NodeSet.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/NodeSet.java
@@ -23,6 +23,7 @@
import java.util.Collection;
import java.util.HashSet;
import java.util.LinkedHashSet;
+import java.util.List;
import java.util.Set;
/**
@@ -111,8 +112,9 @@
return b;
}
+ @SuppressWarnings("unchecked")
public <T extends WriterNode> Collection<T> subset(Class<T> t) {
- ArrayList<T> r = new ArrayList<T>(size());
+ List<T> r = new ArrayList<T>(size());
for( WriterNode n : this )
if(t.isInstance(n))
r.add((T)n);
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Ref.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Ref.java
index 8742395..6958e86 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Ref.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Ref.java
@@ -38,6 +38,7 @@
return def.isInline();
}
+ @Override
void generate(JDefinedClass clazz, NodeSet nset, Set<Prop> props) {
def.generate(clazz,nset,props);
}
diff --git a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Value.java b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Value.java
index b50a709..a898720 100644
--- a/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Value.java
+++ b/jaxb-ri/txw/compiler/src/main/java/com/sun/tools/txw2/model/Value.java
@@ -39,10 +39,12 @@
this.name = name;
}
+ @Override
void generate(JDefinedClass clazz, NodeSet nset, Set<Prop> props) {
createDataMethod(clazz,type,nset,props);
}
+ @Override
public JType getDatatype(NodeSet nset) {
// TODO: enum support
return type;
diff --git a/jaxb-ri/txw/compiler/src/main/java/module-info.java b/jaxb-ri/txw/compiler/src/main/java/module-info.java
index 0c728be..728ca77 100644
--- a/jaxb-ri/txw/compiler/src/main/java/module-info.java
+++ b/jaxb-ri/txw/compiler/src/main/java/module-info.java
@@ -20,4 +20,7 @@
exports com.sun.tools.txw2;
exports com.sun.tools.txw2.model;
exports com.sun.tools.txw2.model.prop;
+
+ uses com.sun.tools.rngdatatype.DatatypeLibraryFactory;
+
}
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Cdata.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Cdata.java
index f337c7d..bcd3737 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Cdata.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Cdata.java
@@ -20,6 +20,7 @@
super(document, nsResolver, obj);
}
+ @Override
void accept(ContentVisitor visitor) {
visitor.onCdata(buffer);
}
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Comment.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Comment.java
index 76c5781..b1c3fce 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Comment.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Comment.java
@@ -25,10 +25,12 @@
document.writeValue(obj,nsResolver,buffer);
}
+ @Override
boolean concludesPendingStartTag() {
return false;
}
+ @Override
void accept(ContentVisitor visitor) {
visitor.onComment(buffer);
}
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/ContainerElement.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/ContainerElement.java
index c846f68..771a38a 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/ContainerElement.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/ContainerElement.java
@@ -85,6 +85,7 @@
return tail==null;
}
+ @Override
public Document getDocument() {
return document;
}
@@ -93,10 +94,12 @@
return blocked && !isCommitted();
}
+ @Override
public void block() {
blocked = true;
}
+ @Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
if(method.getDeclaringClass()==TypedXmlWriter.class || method.getDeclaringClass()==Object.class) {
// forward to myself
@@ -230,10 +233,12 @@
tail = child;
}
+ @Override
public void commit() {
commit(true);
}
+ @Override
public void commit(boolean includingAllPredecessors) {
_commit(includingAllPredecessors);
document.flush();
@@ -280,23 +285,28 @@
this.prevOpen = null;
}
+ @Override
public void _attribute(String localName, Object value) {
_attribute("",localName,value);
}
+ @Override
public void _attribute(String nsUri, String localName, Object value) {
checkStartTag();
startTag.addAttribute(nsUri,localName,value);
}
+ @Override
public void _attribute(QName attributeName, Object value) {
_attribute(attributeName.getNamespaceURI(),attributeName.getLocalPart(),value);
}
+ @Override
public void _namespace(String uri) {
_namespace(uri,false);
}
+ @Override
public void _namespace(String uri, String prefix) {
if(prefix==null)
throw new IllegalArgumentException();
@@ -304,41 +314,50 @@
startTag.addNamespaceDecl(uri,prefix,false);
}
+ @Override
public void _namespace(String uri, boolean requirePrefix) {
checkStartTag();
startTag.addNamespaceDecl(uri,null,requirePrefix);
}
+ @Override
public void _pcdata(Object value) {
// we need to allow this method even when startTag has already been completed.
// checkStartTag();
addChild(new Pcdata(document,startTag,value));
}
+ @Override
public void _cdata(Object value) {
addChild(new Cdata(document,startTag,value));
}
+ @Override
public void _comment(Object value) throws UnsupportedOperationException {
addChild(new Comment(document,startTag,value));
}
+ @Override
public <T extends TypedXmlWriter> T _element(String localName, Class<T> contentModel) {
return _element(nsUri,localName,contentModel);
}
+ @Override
public <T extends TypedXmlWriter> T _element(QName tagName, Class<T> contentModel) {
return _element(tagName.getNamespaceURI(),tagName.getLocalPart(),contentModel);
}
+ @Override
public <T extends TypedXmlWriter> T _element(Class<T> contentModel) {
return _element(TXW.getTagName(contentModel),contentModel);
}
+ @Override
public <T extends TypedXmlWriter> T _cast(Class<T> facadeType) {
return facadeType.cast(Proxy.newProxyInstance(facadeType.getClassLoader(),new Class<?>[]{facadeType},this));
}
+ @Override
public <T extends TypedXmlWriter> T _element(String nsUri, String localName, Class<T> contentModel) {
ContainerElement child = new ContainerElement(document,this,nsUri,localName);
addChild(child.startTag);
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/DatatypeWriter.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/DatatypeWriter.java
index 780690d..d83204d 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/DatatypeWriter.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/DatatypeWriter.java
@@ -46,41 +46,51 @@
@SuppressWarnings({"unchecked", "rawtypes"})
private DatatypeWriter<Object>[] BUILTIN_ARRAY = new DatatypeWriter[] {
new DatatypeWriter<String>() {
+ @Override
public Class<String> getType() {
return String.class;
}
+ @Override
public void print(String s, NamespaceResolver resolver, StringBuilder buf) {
buf.append(s);
}
},
new DatatypeWriter<Integer>() {
+ @Override
public Class<Integer> getType() {
return Integer.class;
}
+ @Override
public void print(Integer i, NamespaceResolver resolver, StringBuilder buf) {
buf.append(i);
}
},
new DatatypeWriter<Float>() {
+ @Override
public Class<Float> getType() {
return Float.class;
}
+ @Override
public void print(Float f, NamespaceResolver resolver, StringBuilder buf) {
buf.append(f);
}
},
new DatatypeWriter<Double>() {
+ @Override
public Class<Double> getType() {
return Double.class;
}
+ @Override
public void print(Double d, NamespaceResolver resolver, StringBuilder buf) {
buf.append(d);
}
},
new DatatypeWriter<QName>() {
+ @Override
public Class<QName> getType() {
return QName.class;
}
+ @Override
public void print(QName qn, NamespaceResolver resolver, StringBuilder buf) {
String p = resolver.getPrefix(qn.getNamespaceURI());
if(p.length()!=0)
@@ -90,10 +100,12 @@
}
};
+ @Override
public DatatypeWriter<Object> get(int n) {
return BUILTIN_ARRAY[n];
}
+ @Override
public int size() {
return BUILTIN_ARRAY.length;
}
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Document.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Document.java
index 6186e89..7c0e4d1 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Document.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Document.java
@@ -144,6 +144,7 @@
// I wanted to hide those write method from users
private final ContentVisitor visitor = new ContentVisitor() {
+ @Override
public void onStartDocument() {
// the startDocument token is used as the sentry, so this method shall never
// be called.
@@ -151,34 +152,40 @@
throw new IllegalStateException();
}
+ @Override
public void onEndDocument() {
out.endDocument();
}
+ @Override
public void onEndTag() {
out.endTag();
inscopeNamespace.popContext();
activeNamespaces = null;
}
+ @Override
public void onPcdata(StringBuilder buffer) {
if(activeNamespaces!=null)
buffer = fixPrefix(buffer);
out.text(buffer);
}
+ @Override
public void onCdata(StringBuilder buffer) {
if(activeNamespaces!=null)
buffer = fixPrefix(buffer);
out.cdata(buffer);
}
+ @Override
public void onComment(StringBuilder buffer) {
if(activeNamespaces!=null)
buffer = fixPrefix(buffer);
out.comment(buffer);
}
+ @Override
public void onStartTag(String nsUri, String localName, Attribute attributes, NamespaceDecl namespaces) {
assert nsUri!=null;
assert localName!=null;
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/EndDocument.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/EndDocument.java
index 2733e96..fbf0981 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/EndDocument.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/EndDocument.java
@@ -14,10 +14,12 @@
* @author Kohsuke Kawaguchi
*/
final class EndDocument extends Content {
+ @Override
boolean concludesPendingStartTag() {
return true;
}
+ @Override
void accept(ContentVisitor visitor) {
visitor.onEndDocument();
}
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/EndTag.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/EndTag.java
index c99143b..f9b6f58 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/EndTag.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/EndTag.java
@@ -14,10 +14,12 @@
* @author Kohsuke Kawaguchi
*/
final class EndTag extends Content {
+ @Override
boolean concludesPendingStartTag() {
return true;
}
+ @Override
void accept(ContentVisitor visitor) {
visitor.onEndTag();
}
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Pcdata.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Pcdata.java
index a3ba782..b1ffafb 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Pcdata.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Pcdata.java
@@ -20,6 +20,7 @@
super(document, nsResolver, obj);
}
+ @Override
void accept(ContentVisitor visitor) {
visitor.onPcdata(buffer);
}
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/StartDocument.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/StartDocument.java
index 8b762bb..41e1e66 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/StartDocument.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/StartDocument.java
@@ -14,10 +14,12 @@
* @author Kohsuke Kawaguchi
*/
final class StartDocument extends Content {
+ @Override
boolean concludesPendingStartTag() {
return true;
}
+ @Override
void accept(ContentVisitor visitor) {
visitor.onStartDocument();
}
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/StartTag.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/StartTag.java
index ca50b53..c2d0c3c 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/StartTag.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/StartTag.java
@@ -195,6 +195,7 @@
* A {@link StartTag} can be only written after
* we are sure that all the necessary namespace declarations are given.
*/
+ @Override
boolean isReadyToCommit() {
if(owner!=null && owner.isBlocked())
return false;
@@ -206,6 +207,7 @@
return false;
}
+ @Override
public void written() {
firstAtt = lastAtt = null;
uri = null;
@@ -215,14 +217,17 @@
}
}
+ @Override
boolean concludesPendingStartTag() {
return true;
}
+ @Override
void accept(ContentVisitor visitor) {
visitor.onStartTag(uri,localName,firstAtt,firstNs);
}
+ @Override
public String getPrefix(String nsUri) {
NamespaceDecl ns = addNamespaceDecl(nsUri,null,false);
if(ns.prefix!=null)
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Text.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Text.java
index db670e4..72c14f3 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Text.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/Text.java
@@ -25,6 +25,7 @@
document.writeValue(obj,nsResolver,buffer);
}
+ @Override
boolean concludesPendingStartTag() {
return false;
}
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DataWriter.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DataWriter.java
index a6c36ee..4f9cc6b 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DataWriter.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DataWriter.java
@@ -178,6 +178,7 @@
*
* @see XMLWriter#reset()
*/
+ @Override
public void reset ()
{
depth = 0;
@@ -206,6 +207,7 @@
* down the chain raises an exception.
* @see XMLWriter#startElement(String, String, String, Attributes)
*/
+ @Override
public void startElement (String uri, String localName,
String qName, Attributes atts)
throws SAXException
@@ -239,6 +241,7 @@
* down the chain raises an exception.
* @see XMLWriter#endElement(String, String, String)
*/
+ @Override
public void endElement (String uri, String localName, String qName)
throws SAXException
{
@@ -295,6 +298,7 @@
* down the chain raises an exception.
* @see XMLWriter#characters(char[], int, int)
*/
+ @Override
public void characters (char ch[], int start, int length)
throws SAXException
{
@@ -302,6 +306,7 @@
super.characters(ch, start, length);
}
+ @Override
public void comment(char ch[], int start, int length) throws SAXException {
if (depth > 0) {
super.characters("\n");
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DelegatingXMLStreamWriter.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DelegatingXMLStreamWriter.java
index 6ced3ec..9c8553d 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DelegatingXMLStreamWriter.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DelegatingXMLStreamWriter.java
@@ -26,130 +26,162 @@
this.writer = writer;
}
+ @Override
public void writeStartElement(String localName) throws XMLStreamException {
writer.writeStartElement(localName);
}
+ @Override
public void writeStartElement(String namespaceURI, String localName) throws XMLStreamException {
writer.writeStartElement(namespaceURI, localName);
}
+ @Override
public void writeStartElement(String prefix, String localName, String namespaceURI) throws XMLStreamException {
writer.writeStartElement(prefix, localName, namespaceURI);
}
+ @Override
public void writeEmptyElement(String namespaceURI, String localName) throws XMLStreamException {
writer.writeEmptyElement(namespaceURI, localName);
}
+ @Override
public void writeEmptyElement(String prefix, String localName, String namespaceURI) throws XMLStreamException {
writer.writeEmptyElement(prefix, localName, namespaceURI);
}
+ @Override
public void writeEmptyElement(String localName) throws XMLStreamException {
writer.writeEmptyElement(localName);
}
+ @Override
public void writeEndElement() throws XMLStreamException {
writer.writeEndElement();
}
+ @Override
public void writeEndDocument() throws XMLStreamException {
writer.writeEndDocument();
}
+ @Override
public void close() throws XMLStreamException {
writer.close();
}
+ @Override
public void flush() throws XMLStreamException {
writer.flush();
}
+ @Override
public void writeAttribute(String localName, String value) throws XMLStreamException {
writer.writeAttribute(localName, value);
}
+ @Override
public void writeAttribute(String prefix, String namespaceURI, String localName, String value) throws XMLStreamException {
writer.writeAttribute(prefix, namespaceURI, localName, value);
}
+ @Override
public void writeAttribute(String namespaceURI, String localName, String value) throws XMLStreamException {
writer.writeAttribute(namespaceURI, localName, value);
}
+ @Override
public void writeNamespace(String prefix, String namespaceURI) throws XMLStreamException {
writer.writeNamespace(prefix, namespaceURI);
}
+ @Override
public void writeDefaultNamespace(String namespaceURI) throws XMLStreamException {
writer.writeDefaultNamespace(namespaceURI);
}
+ @Override
public void writeComment(String data) throws XMLStreamException {
writer.writeComment(data);
}
+ @Override
public void writeProcessingInstruction(String target) throws XMLStreamException {
writer.writeProcessingInstruction(target);
}
+ @Override
public void writeProcessingInstruction(String target, String data) throws XMLStreamException {
writer.writeProcessingInstruction(target, data);
}
+ @Override
public void writeCData(String data) throws XMLStreamException {
writer.writeCData(data);
}
+ @Override
public void writeDTD(String dtd) throws XMLStreamException {
writer.writeDTD(dtd);
}
+ @Override
public void writeEntityRef(String name) throws XMLStreamException {
writer.writeEntityRef(name);
}
+ @Override
public void writeStartDocument() throws XMLStreamException {
writer.writeStartDocument();
}
+ @Override
public void writeStartDocument(String version) throws XMLStreamException {
writer.writeStartDocument(version);
}
+ @Override
public void writeStartDocument(String encoding, String version) throws XMLStreamException {
writer.writeStartDocument(encoding, version);
}
+ @Override
public void writeCharacters(String text) throws XMLStreamException {
writer.writeCharacters(text);
}
+ @Override
public void writeCharacters(char[] text, int start, int len) throws XMLStreamException {
writer.writeCharacters(text, start, len);
}
+ @Override
public String getPrefix(String uri) throws XMLStreamException {
return writer.getPrefix(uri);
}
+ @Override
public void setPrefix(String prefix, String uri) throws XMLStreamException {
writer.setPrefix(prefix, uri);
}
+ @Override
public void setDefaultNamespace(String uri) throws XMLStreamException {
writer.setDefaultNamespace(uri);
}
+ @Override
public void setNamespaceContext(NamespaceContext context) throws XMLStreamException {
writer.setNamespaceContext(context);
}
+ @Override
public NamespaceContext getNamespaceContext() {
return writer.getNamespaceContext();
}
+ @Override
public Object getProperty(String name) throws IllegalArgumentException {
return writer.getProperty(name);
}
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DomSerializer.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DomSerializer.java
index cca6bff..dcdef05 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DomSerializer.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DomSerializer.java
@@ -65,46 +65,57 @@
}
// XmlSerializer api's - delegate to SaxSerializer
+ @Override
public void startDocument() {
serializer.startDocument();
}
+ @Override
public void beginStartTag(String uri, String localName, String prefix) {
serializer.beginStartTag(uri, localName, prefix);
}
+ @Override
public void writeAttribute(String uri, String localName, String prefix, StringBuilder value) {
serializer.writeAttribute(uri, localName, prefix, value);
}
+ @Override
public void writeXmlns(String prefix, String uri) {
serializer.writeXmlns(prefix, uri);
}
+ @Override
public void endStartTag(String uri, String localName, String prefix) {
serializer.endStartTag(uri, localName, prefix);
}
+ @Override
public void endTag() {
serializer.endTag();
}
+ @Override
public void text(StringBuilder text) {
serializer.text(text);
}
+ @Override
public void cdata(StringBuilder text) {
serializer.cdata(text);
}
+ @Override
public void comment(StringBuilder comment) {
serializer.comment(comment);
}
+ @Override
public void endDocument() {
serializer.endDocument();
}
+ @Override
public void flush() {
// no flushing
}
@@ -165,12 +176,15 @@
return _node;
}
+ @Override
public void startDocument() {
}
+ @Override
public void endDocument(){
}
+ @Override
public void startElement(String namespace, String localName, String qName, Attributes attrs){
// some broken DOM implementatino (we confirmed it with SAXON)
@@ -231,11 +245,13 @@
return _nodeStk.peek();
}
+ @Override
public void endElement(String namespace, String localName, String qName){
_nodeStk.pop();
}
+ @Override
public void characters(char[] ch, int start, int length) {
Node text;
if(inCDATA)
@@ -245,52 +261,65 @@
getParent().appendChild(text);
}
+ @Override
public void comment(char ch[], int start, int length) throws SAXException {
getParent().appendChild(_document.createComment(new String(ch,start,length)));
}
+ @Override
public void ignorableWhitespace(char[] ch, int start, int length) {
}
+ @Override
public void processingInstruction(String target, String data) throws org.xml.sax.SAXException{
Node node = _document.createProcessingInstruction(target, data);
getParent().appendChild(node);
}
+ @Override
public void setDocumentLocator(Locator locator) {
}
+ @Override
public void skippedEntity(String name) {
}
private List<String> unprocessedNamespaces = new ArrayList<>();
+ @Override
public void startPrefixMapping(String prefix, String uri) {
unprocessedNamespaces.add(prefix);
unprocessedNamespaces.add(uri);
}
+ @Override
public void endPrefixMapping(String prefix) {
}
+ @Override
public void startDTD(String name, String publicId, String systemId) throws SAXException {
}
+ @Override
public void endDTD() throws SAXException {
}
+ @Override
public void startEntity(String name) throws SAXException {
}
+ @Override
public void endEntity(String name) throws SAXException {
}
+ @Override
public void startCDATA() throws SAXException {
inCDATA = true;
}
+ @Override
public void endCDATA() throws SAXException {
inCDATA = false;
}
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DumbEscapeHandler.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DumbEscapeHandler.java
index c385b31..4d95cc1 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DumbEscapeHandler.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DumbEscapeHandler.java
@@ -29,6 +29,7 @@
public static final CharacterEscapeHandler theInstance = new DumbEscapeHandler();
+ @Override
public void escape(char[] ch, int start, int length, boolean isAttVal, Writer out) throws IOException {
int limit = start+length;
for (int i = start; i < limit; i++) {
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DumpSerializer.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DumpSerializer.java
index fe58c7b..d9823ea 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DumpSerializer.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/DumpSerializer.java
@@ -26,50 +26,61 @@
this.out = out;
}
+ @Override
public void beginStartTag(String uri, String localName, String prefix) {
out.println('<'+prefix+':'+localName);
}
+ @Override
public void writeAttribute(String uri, String localName, String prefix, StringBuilder value) {
out.println('@'+prefix+':'+localName+'='+value);
}
+ @Override
public void writeXmlns(String prefix, String uri) {
out.println("xmlns:"+prefix+'='+uri);
}
+ @Override
public void endStartTag(String uri, String localName, String prefix) {
out.println('>');
}
+ @Override
public void endTag() {
out.println("</ >");
}
+ @Override
public void text(StringBuilder text) {
out.println(text);
}
+ @Override
public void cdata(StringBuilder text) {
out.println("<![CDATA[");
out.println(text);
out.println("]]>");
}
+ @Override
public void comment(StringBuilder comment) {
out.println("<!--");
out.println(comment);
out.println("-->");
}
+ @Override
public void startDocument() {
out.println("<?xml?>");
}
+ @Override
public void endDocument() {
out.println("done");
}
+ @Override
public void flush() {
out.println("flush");
}
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/IndentingXMLFilter.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/IndentingXMLFilter.java
index 1767b45..5312a98 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/IndentingXMLFilter.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/IndentingXMLFilter.java
@@ -115,6 +115,7 @@
* down the chain raises an exception.
* @see XMLWriter#startElement(String, String, String,Attributes)
*/
+ @Override
public void startElement (String uri, String localName,
String qName, Attributes atts)
throws SAXException {
@@ -153,6 +154,7 @@
* down the chain raises an exception.
* @see XMLWriter#endElement(String, String, String)
*/
+ @Override
public void endElement (String uri, String localName, String qName)
throws SAXException
{
@@ -209,6 +211,7 @@
* down the chain raises an exception.
* @see XMLWriter#characters(char[], int, int)
*/
+ @Override
public void characters (char ch[], int start, int length)
throws SAXException
{
@@ -216,6 +219,7 @@
super.characters(ch, start, length);
}
+ @Override
public void comment(char ch[], int start, int length) throws SAXException {
if (depth > 0) {
writeNewLine();
@@ -225,31 +229,37 @@
lexical.comment(ch,start,length);
}
+ @Override
public void startDTD(String name, String publicId, String systemId) throws SAXException {
if(lexical!=null)
lexical.startDTD(name, publicId, systemId);
}
+ @Override
public void endDTD() throws SAXException {
if(lexical!=null)
lexical.endDTD();
}
+ @Override
public void startEntity(String name) throws SAXException {
if(lexical!=null)
lexical.startEntity(name);
}
+ @Override
public void endEntity(String name) throws SAXException {
if(lexical!=null)
lexical.endEntity(name);
}
+ @Override
public void startCDATA() throws SAXException {
if(lexical!=null)
lexical.startCDATA();
}
+ @Override
public void endCDATA() throws SAXException {
if(lexical!=null)
lexical.endCDATA();
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/IndentingXMLStreamWriter.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/IndentingXMLStreamWriter.java
index 041f4cb..cca5218 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/IndentingXMLStreamWriter.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/IndentingXMLStreamWriter.java
@@ -115,66 +115,79 @@
}
+ @Override
public void writeStartDocument() throws XMLStreamException {
super.writeStartDocument();
super.writeCharacters("\n");
}
+ @Override
public void writeStartDocument(String version) throws XMLStreamException {
super.writeStartDocument(version);
super.writeCharacters("\n");
}
+ @Override
public void writeStartDocument(String encoding, String version) throws XMLStreamException {
super.writeStartDocument(encoding, version);
super.writeCharacters("\n");
}
+ @Override
public void writeStartElement(String localName) throws XMLStreamException {
onStartElement();
super.writeStartElement(localName);
}
+ @Override
public void writeStartElement(String namespaceURI, String localName) throws XMLStreamException {
onStartElement();
super.writeStartElement(namespaceURI, localName);
}
+ @Override
public void writeStartElement(String prefix, String localName, String namespaceURI) throws XMLStreamException {
onStartElement();
super.writeStartElement(prefix, localName, namespaceURI);
}
+ @Override
public void writeEmptyElement(String namespaceURI, String localName) throws XMLStreamException {
onEmptyElement();
super.writeEmptyElement(namespaceURI, localName);
}
+ @Override
public void writeEmptyElement(String prefix, String localName, String namespaceURI) throws XMLStreamException {
onEmptyElement();
super.writeEmptyElement(prefix, localName, namespaceURI);
}
+ @Override
public void writeEmptyElement(String localName) throws XMLStreamException {
onEmptyElement();
super.writeEmptyElement(localName);
}
+ @Override
public void writeEndElement() throws XMLStreamException {
onEndElement();
super.writeEndElement();
}
+ @Override
public void writeCharacters(String text) throws XMLStreamException {
state = SEEN_DATA;
super.writeCharacters(text);
}
+ @Override
public void writeCharacters(char[] text, int start, int len) throws XMLStreamException {
state = SEEN_DATA;
super.writeCharacters(text, start, len);
}
+ @Override
public void writeCData(String data) throws XMLStreamException {
state = SEEN_DATA;
super.writeCData(data);
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/SaxSerializer.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/SaxSerializer.java
index 6b36806..96020dc 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/SaxSerializer.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/SaxSerializer.java
@@ -62,6 +62,7 @@
// XmlSerializer implementation
+ @Override
public void startDocument() {
try {
writer.startDocument();
@@ -74,6 +75,7 @@
// add in #writeXmlns and fired in #endStartTag
private final Stack<String> prefixBindings = new Stack<>();
+ @Override
public void writeXmlns(String prefix, String uri) {
// defend against parsers that pass null in for "xmlns" prefix
if (prefix == null) {
@@ -91,6 +93,7 @@
// element stack
private final Stack<String> elementBindings = new Stack<>();
+ @Override
public void beginStartTag(String uri, String localName, String prefix) {
// save element bindings for #endTag
elementBindings.add(getQName(prefix, localName));
@@ -103,6 +106,7 @@
// handler in #endStartTag
private final AttributesImpl attrs = new AttributesImpl();
+ @Override
public void writeAttribute(String uri, String localName, String prefix, StringBuilder value) {
attrs.addAttribute(uri,
localName,
@@ -111,6 +115,7 @@
value.toString());
}
+ @Override
public void endStartTag(String uri, String localName, String prefix) {
try {
while (prefixBindings.size() != 0) {
@@ -130,6 +135,7 @@
}
}
+ @Override
public void endTag() {
try {
writer.endElement(elementBindings.pop(), // uri
@@ -141,6 +147,7 @@
}
}
+ @Override
public void text(StringBuilder text) {
try {
writer.characters(text.toString().toCharArray(), 0, text.length());
@@ -149,6 +156,7 @@
}
}
+ @Override
public void cdata(StringBuilder text) {
if(lexical==null)
throw new UnsupportedOperationException("LexicalHandler is needed to write PCDATA");
@@ -162,6 +170,7 @@
}
}
+ @Override
public void comment(StringBuilder comment) {
try {
if(lexical==null)
@@ -173,6 +182,7 @@
}
}
+ @Override
public void endDocument() {
try {
writer.endDocument();
@@ -181,6 +191,7 @@
}
}
+ @Override
public void flush() {
// noop
}
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/StaxSerializer.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/StaxSerializer.java
index 1bc2a0e..628b7d4 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/StaxSerializer.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/StaxSerializer.java
@@ -36,6 +36,7 @@
this.out = writer;
}
+ @Override
public void startDocument() {
try {
out.writeStartDocument();
@@ -44,6 +45,7 @@
}
}
+ @Override
public void beginStartTag(String uri, String localName, String prefix) {
try {
out.writeStartElement(prefix, localName, uri);
@@ -52,6 +54,7 @@
}
}
+ @Override
public void writeAttribute(String uri, String localName, String prefix, StringBuilder value) {
try {
out.writeAttribute(prefix, uri, localName, value.toString());
@@ -60,6 +63,7 @@
}
}
+ @Override
public void writeXmlns(String prefix, String uri) {
try {
if (prefix.length() == 0) {
@@ -75,10 +79,12 @@
}
}
+ @Override
public void endStartTag(String uri, String localName, String prefix) {
// NO-OP
}
+ @Override
public void endTag() {
try {
out.writeEndElement();
@@ -87,6 +93,7 @@
}
}
+ @Override
public void text(StringBuilder text) {
try {
out.writeCharacters(text.toString());
@@ -95,6 +102,7 @@
}
}
+ @Override
public void cdata(StringBuilder text) {
try {
out.writeCData(text.toString());
@@ -103,6 +111,7 @@
}
}
+ @Override
public void comment(StringBuilder comment) {
try {
out.writeComment(comment.toString());
@@ -111,6 +120,7 @@
}
}
+ @Override
public void endDocument() {
try {
out.writeEndDocument();
@@ -120,6 +130,7 @@
}
}
+ @Override
public void flush() {
try {
out.flush();
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/StreamSerializer.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/StreamSerializer.java
index bdcd6ba..7aa99aa 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/StreamSerializer.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/StreamSerializer.java
@@ -70,6 +70,7 @@
// now delegate to the SaxSerializer
serializer = new SaxSerializer(writer,writer,false) {
+ @Override
public void endDocument() {
super.endDocument();
if(autoClose[0]!=null) {
@@ -104,46 +105,57 @@
}
// XmlSerializer api's - delegate to SaxSerializer
+ @Override
public void startDocument() {
serializer.startDocument();
}
+ @Override
public void beginStartTag(String uri, String localName, String prefix) {
serializer.beginStartTag(uri, localName, prefix);
}
+ @Override
public void writeAttribute(String uri, String localName, String prefix, StringBuilder value) {
serializer.writeAttribute(uri, localName, prefix, value);
}
+ @Override
public void writeXmlns(String prefix, String uri) {
serializer.writeXmlns(prefix, uri);
}
+ @Override
public void endStartTag(String uri, String localName, String prefix) {
serializer.endStartTag(uri, localName, prefix);
}
+ @Override
public void endTag() {
serializer.endTag();
}
+ @Override
public void text(StringBuilder text) {
serializer.text(text);
}
+ @Override
public void cdata(StringBuilder text) {
serializer.cdata(text);
}
+ @Override
public void comment(StringBuilder comment) {
serializer.comment(comment);
}
+ @Override
public void endDocument() {
serializer.endDocument();
}
+ @Override
public void flush() {
serializer.flush();
try {
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/TXWResult.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/TXWResult.java
index 8d0be36..87433f9 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/TXWResult.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/TXWResult.java
@@ -41,10 +41,12 @@
this.writer = writer;
}
+ @Override
public String getSystemId() {
return systemId;
}
+ @Override
public void setSystemId(String systemId) {
this.systemId = systemId;
}
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/TXWSerializer.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/TXWSerializer.java
index 2d35915..83bce0e 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/TXWSerializer.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/TXWSerializer.java
@@ -26,46 +26,57 @@
this.txw = txw;
}
+ @Override
public void startDocument() {
throw new UnsupportedOperationException();
}
+ @Override
public void endDocument() {
throw new UnsupportedOperationException();
}
+ @Override
public void beginStartTag(String uri, String localName, String prefix) {
throw new UnsupportedOperationException();
}
+ @Override
public void writeAttribute(String uri, String localName, String prefix, StringBuilder value) {
throw new UnsupportedOperationException();
}
+ @Override
public void writeXmlns(String prefix, String uri) {
throw new UnsupportedOperationException();
}
+ @Override
public void endStartTag(String uri, String localName, String prefix) {
throw new UnsupportedOperationException();
}
+ @Override
public void endTag() {
throw new UnsupportedOperationException();
}
+ @Override
public void text(StringBuilder text) {
throw new UnsupportedOperationException();
}
+ @Override
public void cdata(StringBuilder text) {
throw new UnsupportedOperationException();
}
+ @Override
public void comment(StringBuilder comment) {
throw new UnsupportedOperationException();
}
+ @Override
public void flush() {
throw new UnsupportedOperationException();
}
diff --git a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/XMLWriter.java b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/XMLWriter.java
index d25eba9..d7b83da 100644
--- a/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/XMLWriter.java
+++ b/jaxb-ri/txw/runtime/src/main/java/com/sun/xml/txw2/output/XMLWriter.java
@@ -388,7 +388,8 @@
private final Map<String, String> locallyDeclaredPrefix = new HashMap<>();
- public void startPrefixMapping( String prefix, String uri ) throws SAXException {
+ @Override
+ public void startPrefixMapping(String prefix, String uri ) throws SAXException {
locallyDeclaredPrefix.put(prefix,uri);
}
@@ -407,6 +408,7 @@
* the filter chain raises an exception.
* @see org.xml.sax.ContentHandler#startDocument()
*/
+ @Override
public void startDocument ()
throws SAXException
{
@@ -441,6 +443,7 @@
* the filter chain raises an exception.
* @see org.xml.sax.ContentHandler#endDocument()
*/
+ @Override
public void endDocument ()
throws SAXException
{
@@ -481,6 +484,7 @@
* the filter chain raises an exception.
* @see org.xml.sax.ContentHandler#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
*/
+ @Override
public void startElement (String uri, String localName,
String qName, Attributes atts)
throws SAXException
@@ -551,6 +555,7 @@
* the filter chain raises an exception.
* @see org.xml.sax.ContentHandler#endElement(java.lang.String, java.lang.String, java.lang.String)
*/
+ @Override
public void endElement (String uri, String localName, String qName)
throws SAXException
{
@@ -588,6 +593,7 @@
* the filter chain raises an exception.
* @see org.xml.sax.ContentHandler#characters(char[], int, int)
*/
+ @Override
public void characters (char ch[], int start, int len)
throws SAXException
{
@@ -620,6 +626,7 @@
* the filter chain raises an exception.
* @see org.xml.sax.ContentHandler#ignorableWhitespace(char[], int, int)
*/
+ @Override
public void ignorableWhitespace (char ch[], int start, int length)
throws SAXException
{
@@ -645,6 +652,7 @@
* the filter chain raises an exception.
* @see org.xml.sax.ContentHandler#processingInstruction(java.lang.String, java.lang.String)
*/
+ @Override
public void processingInstruction (String target, String data)
throws SAXException
{
@@ -887,18 +895,23 @@
}
+ @Override
public void startDTD(String name, String publicId, String systemId) throws SAXException {
}
+ @Override
public void endDTD() throws SAXException {
}
+ @Override
public void startEntity(String name) throws SAXException {
}
+ @Override
public void endEntity(String name) throws SAXException {
}
+ @Override
public void startCDATA() throws SAXException {
try {
if (!startTagIsClosed) {
@@ -912,6 +925,7 @@
}
}
+ @Override
public void endCDATA() throws SAXException {
try {
inCDATA = false;
@@ -921,6 +935,7 @@
}
}
+ @Override
public void comment(char ch[], int start, int length) throws SAXException {
try {
output.write("<!--");
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/ModelLoader.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/ModelLoader.java
index a957c06..1601301 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/ModelLoader.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/ModelLoader.java
@@ -198,8 +198,9 @@
this.baseParser = baseParser;
}
+ @Override
public void parse(InputSource source, ContentHandler handler,
- ErrorHandler errorHandler, EntityResolver entityResolver ) throws SAXException, IOException {
+ ErrorHandler errorHandler, EntityResolver entityResolver ) throws SAXException, IOException {
// set up the chain of handlers.
handler = wrapBy( new ExtensionBindingChecker(XMLConstants.W3C_XML_SCHEMA_NS_URI,opt,errorReceiver), handler );
handler = wrapBy( new IncorrectNamespaceURIChecker(errorReceiver), handler );
@@ -432,8 +433,9 @@
XMLParser parser = new XMLParser() {
private final JAXPParser base = new JAXPParser(XmlFactory.createParserFactory(opt.disableXmlSecurity));
+ @Override
public void parse(InputSource source, ContentHandler handler,
- ErrorHandler errorHandler, EntityResolver entityResolver ) throws SAXException, IOException {
+ ErrorHandler errorHandler, EntityResolver entityResolver ) throws SAXException, IOException {
// set up the chain of handlers.
handler = wrapBy( new SpeculationChecker(), handler );
handler = wrapBy( new VersionChecker(null,errorReceiver,entityResolver), handler );
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/addon/accessors/PluginImpl.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/addon/accessors/PluginImpl.java
index 64c989b..a96484a 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/addon/accessors/PluginImpl.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/addon/accessors/PluginImpl.java
@@ -34,10 +34,12 @@
*/
public class PluginImpl extends Plugin {
+ @Override
public String getOptionName() {
return "Xpropertyaccessors";
}
+ @Override
public String getUsage() {
return " -Xpropertyaccessors : Use XmlAccessType PROPERTY instead of FIELD for generated classes";
}
@@ -47,7 +49,8 @@
return 0; // no option recognized
}
- public boolean run( Outline model, Options opt, ErrorHandler errorHandler ) {
+ @Override
+ public boolean run(Outline model, Options opt, ErrorHandler errorHandler ) {
for( ClassOutline co : model.getClasses() ) {
Iterator<JAnnotationUse> ann = co.ref.annotations().iterator();
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/addon/code_injector/PluginImpl.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/addon/code_injector/PluginImpl.java
index cf75664..0928a80 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/addon/code_injector/PluginImpl.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/addon/code_injector/PluginImpl.java
@@ -32,23 +32,28 @@
* @author Kohsuke Kawaguchi
*/
public class PluginImpl extends Plugin {
+ @Override
public String getOptionName() {
return "Xinject-code";
}
+ @Override
public List<String> getCustomizationURIs() {
return Collections.singletonList(Const.NS);
}
+ @Override
public boolean isCustomizationTagName(String nsUri, String localName) {
return Const.NS.equals(nsUri) && "code".equals(localName);
}
+ @Override
public String getUsage() {
return " -Xinject-code : inject specified Java code fragments into the generated code";
}
// meat of the processing
+ @Override
public boolean run(@NotNull Outline model, Options opt, ErrorHandler errorHandler) {
checkAndInject(model.getClasses());
checkAndInject(model.getEnums());
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/addon/episode/PluginImpl.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/addon/episode/PluginImpl.java
index 5003bd4..1d30a8a 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/addon/episode/PluginImpl.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/addon/episode/PluginImpl.java
@@ -204,71 +204,88 @@
return "tns:" + decl.getName();
}
+ @Override
public String complexType(XSComplexType type) {
return "~" + name(type);
}
+ @Override
public String simpleType(XSSimpleType simpleType) {
return "~" + name(simpleType);
}
+ @Override
public String elementDecl(XSElementDecl decl) {
return name(decl);
}
// the rest is doing nothing
+ @Override
public String annotation(XSAnnotation ann) {
throw new UnsupportedOperationException();
}
+ @Override
public String attGroupDecl(XSAttGroupDecl decl) {
throw new UnsupportedOperationException();
}
+ @Override
public String attributeDecl(XSAttributeDecl decl) {
throw new UnsupportedOperationException();
}
+ @Override
public String attributeUse(XSAttributeUse use) {
throw new UnsupportedOperationException();
}
+ @Override
public String schema(XSSchema schema) {
throw new UnsupportedOperationException();
}
+ @Override
public String facet(XSFacet facet) {
throw new UnsupportedOperationException();
}
+ @Override
public String notation(XSNotation notation) {
throw new UnsupportedOperationException();
}
+ @Override
public String identityConstraint(XSIdentityConstraint decl) {
throw new UnsupportedOperationException();
}
+ @Override
public String xpath(XSXPath xpath) {
throw new UnsupportedOperationException();
}
+ @Override
public String particle(XSParticle particle) {
throw new UnsupportedOperationException();
}
+ @Override
public String empty(XSContentType empty) {
throw new UnsupportedOperationException();
}
+ @Override
public String wildcard(XSWildcard wc) {
throw new UnsupportedOperationException();
}
+ @Override
public String modelGroupDecl(XSModelGroupDecl decl) {
throw new UnsupportedOperationException();
}
+ @Override
public String modelGroup(XSModelGroup group) {
throw new UnsupportedOperationException();
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CBuiltinLeafInfo.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CBuiltinLeafInfo.java
index 5b91bd1..41dd436 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CBuiltinLeafInfo.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/model/CBuiltinLeafInfo.java
@@ -25,6 +25,8 @@
import jakarta.xml.bind.annotation.adapters.NormalizedStringAdapter;
import jakarta.xml.bind.annotation.adapters.XmlAdapter;
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import javax.xml.XMLConstants;
import javax.xml.datatype.Duration;
import javax.xml.datatype.XMLGregorianCalendar;
import javax.xml.namespace.QName;
@@ -266,7 +268,7 @@
this(c,typeName,org.glassfish.jaxb.core.v2.model.core.ID.NONE);
}
protected Builtin(Class<?> c, String typeName, ID id) {
- super(NavigatorImpl.theInstance.ref(c), id, new QName(WellKnownNamespace.XML_SCHEMA,typeName));
+ super(NavigatorImpl.theInstance.ref(c), id, new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI,typeName));
LEAVES.put(getType(),this);
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/AbstractExtensionBindingChecker.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/AbstractExtensionBindingChecker.java
index e565fb3..c280aba 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/AbstractExtensionBindingChecker.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/AbstractExtensionBindingChecker.java
@@ -26,6 +26,8 @@
import org.glassfish.jaxb.core.v2.WellKnownNamespace;
+import javax.xml.XMLConstants;
+
/**
* Common code between {@code DTDExtensionBindingChecker} and {@link ExtensionBindingChecker}.
*
@@ -162,7 +164,7 @@
@Override
public void startPrefixMapping(String prefix, String uri) throws SAXException {
- if (WellKnownNamespace.XML_NAMESPACE_URI.equals(uri)) return;
+ if (XMLConstants.XML_NS_URI.equals(uri)) return;
super.startPrefixMapping(prefix, uri); //xml prefix shall not be declared based on jdk api javado
nsSupport.pushContext();
nsSupport.declarePrefix(prefix,uri);
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/Element.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/Element.java
index f5ad8c0..5108f45 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/Element.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/dtd/Element.java
@@ -105,20 +105,24 @@
this.name = name;
}
+ @Override
void normalize(List<Block> r, boolean optional) {
Block o = new Block(optional,false);
o.elements.add(this);
r.add(o);
}
+ @Override
void addAllElements(Block b) {
b.elements.add(this);
}
+ @Override
boolean isOptional() {
return false;
}
+ @Override
boolean isRepeated() {
return false;
}
@@ -293,6 +297,7 @@
}
}
+ @Override
public int compareTo(Element that) {
return this.name.compareTo(that.name);
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/DOMBuilder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/DOMBuilder.java
index 5e7487d..6c36d5f 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/DOMBuilder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/DOMBuilder.java
@@ -53,12 +53,14 @@
private Locator locator;
+ @Override
public void setDocumentLocator(Locator locator) {
this.locator = locator;
super.setDocumentLocator(locator);
}
+ @Override
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) {
super.startElement(namespaceURI, localName, qName, atts);
@@ -80,6 +82,7 @@
}
}
+ @Override
public void endElement(String namespaceURI, String localName, String qName) {
locatorTable.storeEndLocation( getCurrentElement(), locator );
super.endElement(namespaceURI, localName, qName);
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/DOMForestParser.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/DOMForestParser.java
index 93faa67..8496e28 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/DOMForestParser.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/internalizer/DOMForestParser.java
@@ -51,6 +51,7 @@
this.fallbackParser = fallbackParser;
}
+ @Override
public void parse(
InputSource source,
ContentHandler contentHandler,
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/ContentModelBinder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/ContentModelBinder.java
index 9f2ce40..b9deeb9 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/ContentModelBinder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/ContentModelBinder.java
@@ -49,10 +49,12 @@
this.clazz = clazz;
}
+ @Override
public Void onMixed(DMixedPattern p) {
throw new UnsupportedOperationException();
}
+ @Override
public Void onChoice(DChoicePattern p) {
boolean old = insideOptional;
insideOptional = true;
@@ -61,6 +63,7 @@
return null;
}
+ @Override
public Void onOptional(DOptionalPattern p) {
boolean old = insideOptional;
insideOptional = true;
@@ -69,10 +72,12 @@
return null;
}
+ @Override
public Void onZeroOrMore(DZeroOrMorePattern p) {
return onRepeated(p,true);
}
+ @Override
public Void onOneOrMore(DOneOrMorePattern p) {
return onRepeated(p,insideOptional);
@@ -95,6 +100,7 @@
return null;
}
+ @Override
public Void onAttribute(DAttributePattern p) {
// TODO: support multiple names
QName name = p.getName().listNames().iterator().next();
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/DefineFinder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/DefineFinder.java
index fd775b4..13b46d2 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/DefineFinder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/DefineFinder.java
@@ -27,6 +27,7 @@
public final Set<DDefine> defs = new HashSet<>();
+ @Override
public Void onGrammar(DGrammarPattern p) {
for( DDefine def : p ) {
defs.add(def);
@@ -40,6 +41,7 @@
* We visit all {@link DDefine}s from {@link DGrammarPattern},
* so no point in resolving refs.
*/
+ @Override
public Void onRef(DRefPattern p) {
return null;
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/RELAXNGCompiler.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/RELAXNGCompiler.java
index eafc137..28357f1 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/RELAXNGCompiler.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/RELAXNGCompiler.java
@@ -208,10 +208,12 @@
// also look for root elements
grammar.accept(new DPatternWalker() {
+ @Override
public Void onRef(DRefPattern p) {
return null; // stop recursion
}
+ @Override
public Void onElement(DElementPattern p) {
mapToClass(p);
return null;
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/RawTypeSetBuilder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/RawTypeSetBuilder.java
index c7f7279..b42e267 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/RawTypeSetBuilder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/RawTypeSetBuilder.java
@@ -62,11 +62,13 @@
return new RawTypeSet(refs,mul);
}
+ @Override
public Void onAttribute(DAttributePattern p) {
// attributes form their own properties
return null;
}
+ @Override
public Void onElement(DElementPattern p) {
CTypeInfo[] tis = compiler.classes.get(p);
if(tis!=null) {
@@ -79,11 +81,13 @@
return null;
}
+ @Override
public Void onZeroOrMore(DZeroOrMorePattern p) {
mul = mul.makeRepeated();
return super.onZeroOrMore(p);
}
+ @Override
public Void onOneOrMore(DOneOrMorePattern p) {
mul = mul.makeRepeated();
return super.onOneOrMore(p);
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/TypePatternBinder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/TypePatternBinder.java
index 55b54da..4e35820 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/TypePatternBinder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/TypePatternBinder.java
@@ -45,6 +45,7 @@
stack.clear();
}
+ @Override
public Void onRef(DRefPattern p) {
if(!canInherit) {
cannotBeInherited.add(p.getTarget());
@@ -65,6 +66,7 @@
All the following code are the same
*/
+ @Override
public Void onChoice(DChoicePattern p) {
push(false);
super.onChoice(p);
@@ -72,6 +74,7 @@
return null;
}
+ @Override
public Void onAttribute(DAttributePattern p) {
push(false);
super.onAttribute(p);
@@ -79,6 +82,7 @@
return null;
}
+ @Override
public Void onList(DListPattern p) {
push(false);
super.onList(p);
@@ -86,6 +90,7 @@
return null;
}
+ @Override
public Void onMixed(DMixedPattern p) {
push(false);
super.onMixed(p);
@@ -93,6 +98,7 @@
return null;
}
+ @Override
public Void onOneOrMore(DOneOrMorePattern p) {
push(false);
super.onOneOrMore(p);
@@ -100,6 +106,7 @@
return null;
}
+ @Override
public Void onZeroOrMore(DZeroOrMorePattern p) {
push(false);
super.onZeroOrMore(p);
@@ -107,6 +114,7 @@
return null;
}
+ @Override
public Void onOptional(DOptionalPattern p) {
push(false);
super.onOptional(p);
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/TypeUseBinder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/TypeUseBinder.java
index 453031e..496c3ac 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/TypeUseBinder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/relaxng/TypeUseBinder.java
@@ -52,19 +52,23 @@
}
+ @Override
public TypeUse onGrammar(DGrammarPattern p) {
return CBuiltinLeafInfo.STRING;
}
+ @Override
public TypeUse onChoice(DChoicePattern p) {
// can't support unions
return CBuiltinLeafInfo.STRING;
}
+ @Override
public TypeUse onData(DDataPattern p) {
return onDataType(p.getDatatypeLibrary(), p.getType());
}
+ @Override
public TypeUse onValue(DValuePattern p) {
return onDataType(p.getDatatypeLibrary(),p.getType());
}
@@ -81,10 +85,12 @@
return CBuiltinLeafInfo.STRING;
}
+ @Override
public TypeUse onInterleave(DInterleavePattern p) {
return onContainer(p);
}
+ @Override
public TypeUse onGroup(DGroupPattern p) {
return onContainer(p);
}
@@ -100,36 +106,44 @@
return t;
}
+ @Override
public TypeUse onNotAllowed(DNotAllowedPattern p) {
// TODO
return error();
}
+ @Override
public TypeUse onEmpty(DEmptyPattern p) {
return CBuiltinLeafInfo.STRING;
}
+ @Override
public TypeUse onList(DListPattern p) {
return p.getChild().accept(this);
}
+ @Override
public TypeUse onOneOrMore(DOneOrMorePattern p) {
return TypeUseFactory.makeCollection( p.getChild().accept(this) );
}
+ @Override
public TypeUse onZeroOrMore(DZeroOrMorePattern p) {
return TypeUseFactory.makeCollection( p.getChild().accept(this) );
}
+ @Override
public TypeUse onOptional(DOptionalPattern p) {
return CBuiltinLeafInfo.STRING;
}
+ @Override
public TypeUse onRef(DRefPattern p) {
// TODO: check for enums
return p.getTarget().getPattern().accept(this);
}
+ @Override
public TypeUse onText(DTextPattern p) {
return CBuiltinLeafInfo.STRING;
}
@@ -139,14 +153,17 @@
// Not allowed in this context
//
//
+ @Override
public TypeUse onAttribute(DAttributePattern p) {
return error();
}
+ @Override
public TypeUse onElement(DElementPattern p) {
return error();
}
+ @Override
public TypeUse onMixed(DMixedPattern p) {
return error();
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindBlue.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindBlue.java
index 4ed8c4f..4a487da 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindBlue.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindBlue.java
@@ -29,11 +29,13 @@
*/
final class BindBlue extends ColorBinder {
+ @Override
public void complexType(XSComplexType ct) {
// TODO: implement this method later
throw new UnsupportedOperationException();
}
+ @Override
public void elementDecl(XSElementDecl e) {
// TODO: implement this method later
throw new UnsupportedOperationException();
@@ -42,41 +44,49 @@
+ @Override
public void wildcard(XSWildcard xsWildcard) {
// TODO: implement this method later
throw new UnsupportedOperationException();
}
+ @Override
public void attGroupDecl(XSAttGroupDecl xsAttGroupDecl) {
// TODO
throw new UnsupportedOperationException();
}
+ @Override
public void attributeDecl(XSAttributeDecl xsAttributeDecl) {
// TODO
throw new UnsupportedOperationException();
}
+ @Override
public void attributeUse(XSAttributeUse use) {
// TODO
throw new UnsupportedOperationException();
}
+ @Override
public void modelGroupDecl(XSModelGroupDecl xsModelGroupDecl) {
// TODO
throw new UnsupportedOperationException();
}
+ @Override
public void modelGroup(XSModelGroup xsModelGroup) {
// TODO
throw new UnsupportedOperationException();
}
+ @Override
public void particle(XSParticle xsParticle) {
// TODO
throw new UnsupportedOperationException();
}
+ @Override
public void empty(XSContentType xsContentType) {
// TODO
throw new UnsupportedOperationException();
@@ -86,6 +96,7 @@
/**
* Components that always map to a type
*/
+ @Override
public void simpleType(XSSimpleType type) {
throw new IllegalStateException();
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindGreen.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindGreen.java
index 7a94e30..de4f369 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindGreen.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindGreen.java
@@ -34,6 +34,7 @@
private final ComplexTypeFieldBuilder ctBuilder = Ring.get(ComplexTypeFieldBuilder.class);
+ @Override
public void attGroupDecl(XSAttGroupDecl ag) {
attContainer(ag);
}
@@ -52,6 +53,7 @@
builder.ying(w,cont);
}
+ @Override
public void complexType(XSComplexType ct) {
ctBuilder.build(ct);
}
@@ -63,36 +65,43 @@
+ @Override
public void attributeDecl(XSAttributeDecl xsAttributeDecl) {
// TODO: implement this method later
throw new UnsupportedOperationException();
}
+ @Override
public void wildcard(XSWildcard xsWildcard) {
// TODO: implement this method later
throw new UnsupportedOperationException();
}
+ @Override
public void modelGroupDecl(XSModelGroupDecl xsModelGroupDecl) {
// TODO: implement this method later
throw new UnsupportedOperationException();
}
+ @Override
public void modelGroup(XSModelGroup xsModelGroup) {
// TODO: implement this method later
throw new UnsupportedOperationException();
}
+ @Override
public void elementDecl(XSElementDecl xsElementDecl) {
// TODO: implement this method later
throw new UnsupportedOperationException();
}
+ @Override
public void particle(XSParticle xsParticle) {
// TODO: implement this method later
throw new UnsupportedOperationException();
}
+ @Override
public void empty(XSContentType xsContentType) {
// TODO: implement this method later
throw new UnsupportedOperationException();
@@ -104,11 +113,13 @@
Components for which ying should yield to purple.
*/
+ @Override
public void simpleType(XSSimpleType xsSimpleType) {
// simple type always maps to a type, so this is never possible
throw new IllegalStateException();
}
+ @Override
public void attributeUse(XSAttributeUse use) {
// attribute use always maps to a property
throw new IllegalStateException();
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindPurple.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindPurple.java
index 591d45f..c40a2da 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindPurple.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindPurple.java
@@ -33,11 +33,13 @@
* @author Kohsuke Kawaguchi
*/
public class BindPurple extends ColorBinder {
+ @Override
public void attGroupDecl(XSAttGroupDecl xsAttGroupDecl) {
// TODO
throw new UnsupportedOperationException();
}
+ @Override
public void attributeDecl(XSAttributeDecl xsAttributeDecl) {
// TODO
throw new UnsupportedOperationException();
@@ -46,6 +48,7 @@
/**
* Attribute use always becomes a property.
*/
+ @Override
public void attributeUse(XSAttributeUse use) {
boolean hasFixedValue = use.getFixedValue()!=null;
BIProperty pc = BIProperty.getCustomization(use);
@@ -93,6 +96,7 @@
}
+ @Override
public void complexType(XSComplexType ct) {
CClass ctBean = selector.bindToType(ct,null,false);
if(getCurrentBean()!=ctBean)
@@ -101,6 +105,7 @@
getCurrentBean().setBaseClass(ctBean);
}
+ @Override
public void wildcard(XSWildcard xsWildcard) {
// element wildcards are processed by particle binders,
// so this one is for attribute wildcard.
@@ -108,30 +113,36 @@
getCurrentBean().hasAttributeWildcard(true);
}
+ @Override
public void modelGroupDecl(XSModelGroupDecl xsModelGroupDecl) {
// TODO
throw new UnsupportedOperationException();
}
+ @Override
public void modelGroup(XSModelGroup xsModelGroup) {
// TODO
throw new UnsupportedOperationException();
}
+ @Override
public void elementDecl(XSElementDecl xsElementDecl) {
// TODO
throw new UnsupportedOperationException();
}
+ @Override
public void simpleType(XSSimpleType type) {
createSimpleTypeProperty(type,"Value");
}
+ @Override
public void particle(XSParticle xsParticle) {
// TODO
throw new UnsupportedOperationException();
}
+ @Override
public void empty(XSContentType ct) {
// empty generates nothing
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindRed.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindRed.java
index c7bcaf7..7cc1ae6 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindRed.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindRed.java
@@ -34,10 +34,12 @@
private final ComplexTypeFieldBuilder ctBuilder = Ring.get(ComplexTypeFieldBuilder.class);
+ @Override
public void complexType(XSComplexType ct) {
ctBuilder.build(ct);
}
+ @Override
public void wildcard(XSWildcard xsWildcard) {
// TODO: implement this method later
// I guess we might allow this to be mapped to a generic element property ---
@@ -46,6 +48,7 @@
throw new UnsupportedOperationException();
}
+ @Override
public void elementDecl(XSElementDecl e) {
SimpleTypeBuilder stb = Ring.get(SimpleTypeBuilder.class);
stb.refererStack.push(e); // referer is element
@@ -53,6 +56,7 @@
stb.refererStack.pop();
}
+ @Override
public void simpleType(XSSimpleType type) {
SimpleTypeBuilder stb = Ring.get(SimpleTypeBuilder.class);
stb.refererStack.push(type); // referer is itself
@@ -63,24 +67,31 @@
/*
Components that can never be mapped to a class
*/
+ @Override
public void attGroupDecl(XSAttGroupDecl ag) {
throw new IllegalStateException();
}
+ @Override
public void attributeDecl(XSAttributeDecl ad) {
throw new IllegalStateException();
}
+ @Override
public void attributeUse(XSAttributeUse au) {
throw new IllegalStateException();
}
+ @Override
public void empty(XSContentType xsContentType) {
throw new IllegalStateException();
}
+ @Override
public void modelGroupDecl(XSModelGroupDecl xsModelGroupDecl) {
throw new IllegalStateException();
}
+ @Override
public void modelGroup(XSModelGroup xsModelGroup) {
throw new IllegalStateException();
}
+ @Override
public void particle(XSParticle p) {
throw new IllegalStateException();
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindYellow.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindYellow.java
index d424db4..adaf335 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindYellow.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/BindYellow.java
@@ -26,24 +26,29 @@
* @author Kohsuke Kawaguchi
*/
public final class BindYellow extends ColorBinder {
+ @Override
public void complexType(XSComplexType ct) {
}
+ @Override
public void wildcard(XSWildcard xsWildcard) {
// TODO: implement this method later
throw new UnsupportedOperationException();
}
+ @Override
public void elementDecl(XSElementDecl xsElementDecl) {
// TODO: implement this method later
throw new UnsupportedOperationException();
}
+ @Override
public void simpleType(XSSimpleType xsSimpleType) {
// TODO: implement this method later
throw new UnsupportedOperationException();
}
+ @Override
public void attributeDecl(XSAttributeDecl xsAttributeDecl) {
// TODO: implement this method later
throw new UnsupportedOperationException();
@@ -55,26 +60,32 @@
Components that can never map to a type
*/
+ @Override
public void attGroupDecl(XSAttGroupDecl xsAttGroupDecl) {
throw new IllegalStateException();
}
+ @Override
public void attributeUse(XSAttributeUse use) {
throw new IllegalStateException();
}
+ @Override
public void modelGroupDecl(XSModelGroupDecl xsModelGroupDecl) {
throw new IllegalStateException();
}
+ @Override
public void modelGroup(XSModelGroup xsModelGroup) {
throw new IllegalStateException();
}
+ @Override
public void particle(XSParticle xsParticle) {
throw new IllegalStateException();
}
+ @Override
public void empty(XSContentType xsContentType) {
throw new IllegalStateException();
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ClassBinderFilter.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ClassBinderFilter.java
index bf734d7..e9623a6 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ClassBinderFilter.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ClassBinderFilter.java
@@ -41,70 +41,87 @@
this.core = core;
}
+ @Override
public CElement annotation(XSAnnotation xsAnnotation) {
return core.annotation(xsAnnotation);
}
+ @Override
public CElement attGroupDecl(XSAttGroupDecl xsAttGroupDecl) {
return core.attGroupDecl(xsAttGroupDecl);
}
+ @Override
public CElement attributeDecl(XSAttributeDecl xsAttributeDecl) {
return core.attributeDecl(xsAttributeDecl);
}
+ @Override
public CElement attributeUse(XSAttributeUse xsAttributeUse) {
return core.attributeUse(xsAttributeUse);
}
+ @Override
public CElement complexType(XSComplexType xsComplexType) {
return core.complexType(xsComplexType);
}
+ @Override
public CElement schema(XSSchema xsSchema) {
return core.schema(xsSchema);
}
+ @Override
public CElement facet(XSFacet xsFacet) {
return core.facet(xsFacet);
}
+ @Override
public CElement notation(XSNotation xsNotation) {
return core.notation(xsNotation);
}
+ @Override
public CElement simpleType(XSSimpleType xsSimpleType) {
return core.simpleType(xsSimpleType);
}
+ @Override
public CElement particle(XSParticle xsParticle) {
return core.particle(xsParticle);
}
+ @Override
public CElement empty(XSContentType xsContentType) {
return core.empty(xsContentType);
}
+ @Override
public CElement wildcard(XSWildcard xsWildcard) {
return core.wildcard(xsWildcard);
}
+ @Override
public CElement modelGroupDecl(XSModelGroupDecl xsModelGroupDecl) {
return core.modelGroupDecl(xsModelGroupDecl);
}
+ @Override
public CElement modelGroup(XSModelGroup xsModelGroup) {
return core.modelGroup(xsModelGroup);
}
+ @Override
public CElement elementDecl(XSElementDecl xsElementDecl) {
return core.elementDecl(xsElementDecl);
}
+ @Override
public CElement identityConstraint(XSIdentityConstraint xsIdentityConstraint) {
return core.identityConstraint(xsIdentityConstraint);
}
+ @Override
public CElement xpath(XSXPath xsxPath) {
return core.xpath(xsxPath);
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ClassSelector.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ClassSelector.java
index 427d1dc..5a4bc14 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ClassSelector.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ClassSelector.java
@@ -49,6 +49,8 @@
import org.xml.sax.Locator;
+import javax.xml.XMLConstants;
+
/**
* Manages association between {@link XSComponent}s and generated
* {@link CTypeInfo}s.
@@ -186,7 +188,7 @@
classScopes.push(null); // so that the getClassFactory method returns null
- XSComplexType anyType = Ring.get(XSSchemaSet.class).getComplexType(WellKnownNamespace.XML_SCHEMA,"anyType");
+ XSComplexType anyType = Ring.get(XSSchemaSet.class).getComplexType(XMLConstants.W3C_XML_SCHEMA_NS_URI,"anyType");
bindMap.put(anyType,new Binding(anyType,CBuiltinLeafInfo.ANYTYPE));
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ColorBinder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ColorBinder.java
index 5d9b9fc..f011641 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ColorBinder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ColorBinder.java
@@ -52,26 +52,32 @@
+ @Override
public final void annotation(XSAnnotation xsAnnotation) {
throw new IllegalStateException();
}
+ @Override
public final void schema(XSSchema xsSchema) {
throw new IllegalStateException();
}
+ @Override
public final void facet(XSFacet xsFacet) {
throw new IllegalStateException();
}
+ @Override
public final void notation(XSNotation xsNotation) {
throw new IllegalStateException();
}
+ @Override
public final void identityConstraint(XSIdentityConstraint xsIdentityConstraint) {
throw new IllegalStateException();
}
+ @Override
public final void xpath(XSXPath xsxPath) {
throw new IllegalStateException();
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/DefaultClassBinder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/DefaultClassBinder.java
index 1a5fe4c..a594499 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/DefaultClassBinder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/DefaultClassBinder.java
@@ -73,23 +73,28 @@
protected final XSSchemaSet schemas = Ring.get(XSSchemaSet.class);
+ @Override
public CElement attGroupDecl(XSAttGroupDecl decl) {
return allow(decl,decl.getName());
}
+ @Override
public CElement attributeDecl(XSAttributeDecl decl) {
return allow(decl,decl.getName());
}
+ @Override
public CElement modelGroup(XSModelGroup mgroup) {
return never();
}
+ @Override
public CElement modelGroupDecl(XSModelGroupDecl decl) {
return never();
}
+ @Override
public CElement complexType(XSComplexType type) {
CElement ci = allow(type,type.getName());
if(ci!=null) return ci;
@@ -244,6 +249,7 @@
return sole;
}
+ @Override
public CElement elementDecl(XSElementDecl decl) {
CElement r = allow(decl,decl.getName());
@@ -288,20 +294,25 @@
return r;
}
- public CClassInfo empty( XSContentType ct ) { return null; }
+ @Override
+ public CClassInfo empty(XSContentType ct ) { return null; }
+ @Override
public CClassInfo identityConstraint(XSIdentityConstraint xsIdentityConstraint) {
return never();
}
+ @Override
public CClassInfo xpath(XSXPath xsxPath) {
return never();
}
+ @Override
public CClassInfo attributeUse(XSAttributeUse use) {
return never();
}
+ @Override
public CElement simpleType(XSSimpleType type) {
CElement c = allow(type,type.getName());
if(c!=null) return c;
@@ -314,30 +325,36 @@
return never();
}
+ @Override
public CClassInfo particle(XSParticle particle) {
return never();
}
+ @Override
public CClassInfo wildcard(XSWildcard wc) {
return never();
}
// these methods won't be used
+ @Override
public CClassInfo annotation(XSAnnotation annon) {
assert false;
return null;
}
+ @Override
public CClassInfo notation(XSNotation not) {
assert false;
return null;
}
+ @Override
public CClassInfo facet(XSFacet decl) {
assert false;
return null;
}
+ @Override
public CClassInfo schema(XSSchema schema) {
assert false;
return null;
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/DefaultParticleBinder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/DefaultParticleBinder.java
index cb9e311..7a759a9 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/DefaultParticleBinder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/DefaultParticleBinder.java
@@ -151,11 +151,13 @@
*/
private XSParticle outerParticle;
+ @Override
public void elementDecl(XSElementDecl decl) {
check(outerParticle);
mark(outerParticle);
}
+ @Override
public void modelGroup(XSModelGroup mg) {
// choice gets mapped to a property
if(mg.getCompositor()== XSModelGroup.Compositor.CHOICE && builder.getGlobalBinding().isChoiceContentPropertyEnabled()) {
@@ -167,10 +169,12 @@
particle(child);
}
+ @Override
public void modelGroupDecl(XSModelGroupDecl decl) {
modelGroup(decl.getModelGroup());
}
+ @Override
public void wildcard(XSWildcard wc) {
mark(outerParticle);
}
@@ -350,21 +354,25 @@
}
}
- public void elementDecl( XSElementDecl e ) {
+ @Override
+ public void elementDecl(XSElementDecl e ) {
// because the corresponding particle must be marked.
assert false;
}
- public void wildcard( XSWildcard wc ) {
+ @Override
+ public void wildcard(XSWildcard wc ) {
// because the corresponding particle must be marked.
assert false;
}
- public void modelGroupDecl( XSModelGroupDecl decl ) {
+ @Override
+ public void modelGroupDecl(XSModelGroupDecl decl ) {
modelGroup(decl.getModelGroup());
}
- public void modelGroup( XSModelGroup mg ) {
+ @Override
+ public void modelGroup(XSModelGroup mg ) {
boolean oldIOP = insideOptionalParticle;
insideOptionalParticle |= mg.getCompositor()==XSModelGroup.CHOICE;
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ExpressionBuilder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ExpressionBuilder.java
index 2a2d453..b4fef02 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ExpressionBuilder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ExpressionBuilder.java
@@ -55,6 +55,7 @@
* We can only have one {@link XmlAnyElement} property,
* so all the wildcards need to be treated as one node.
*/
+ @Override
public Expression wildcard(XSWildcard wc) {
if(wildcard==null)
wildcard = new GWildcardElement();
@@ -63,10 +64,12 @@
return wildcard;
}
+ @Override
public Expression modelGroupDecl(XSModelGroupDecl decl) {
return modelGroup(decl.getModelGroup());
}
+ @Override
public Expression modelGroup(XSModelGroup group) {
XSModelGroup.Compositor comp = group.getCompositor();
if(comp==XSModelGroup.CHOICE) {
@@ -90,6 +93,7 @@
}
}
+ @Override
public Element elementDecl(XSElementDecl decl) {
QName n = BGMBuilder.getName(decl);
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/MultiplicityCounter.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/MultiplicityCounter.java
index 8a10430..d98a9d8 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/MultiplicityCounter.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/MultiplicityCounter.java
@@ -45,14 +45,17 @@
return Multiplicity.multiply( m, Multiplicity.create(p.getMinOccurs(),max) );
}
+ @Override
public Multiplicity wildcard(XSWildcard wc) {
return ONE;
}
+ @Override
public Multiplicity modelGroupDecl(XSModelGroupDecl decl) {
return modelGroup(decl.getModelGroup());
}
+ @Override
public Multiplicity modelGroup(XSModelGroup group) {
boolean isChoice = group.getCompositor() == XSModelGroup.CHOICE;
@@ -74,6 +77,7 @@
return r;
}
+ @Override
public Multiplicity elementDecl(XSElementDecl decl) {
return ONE;
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ParticleBinder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ParticleBinder.java
index d1675f9..fa0e253 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ParticleBinder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ParticleBinder.java
@@ -186,14 +186,17 @@
*/
private boolean rep = repeated;
+ @Override
public void wildcard(XSWildcard wc) {
append("any");
}
+ @Override
public void modelGroupDecl(XSModelGroupDecl mgd) {
modelGroup(mgd.getModelGroup());
}
+ @Override
public void modelGroup(XSModelGroup mg) {
String operator;
if(mg.getCompositor()==XSModelGroup.CHOICE) operator = "Or";
@@ -212,6 +215,7 @@
}
}
+ @Override
public void elementDecl(XSElementDecl ed) {
append(ed.getName());
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/RawTypeSetBuilder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/RawTypeSetBuilder.java
index 944d918..adf50ab 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/RawTypeSetBuilder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/RawTypeSetBuilder.java
@@ -100,19 +100,23 @@
}
}
+ @Override
public void wildcard(XSWildcard wc) {
refs.add(new WildcardRef(wc));
}
+ @Override
public void modelGroupDecl(XSModelGroupDecl decl) {
modelGroup(decl.getModelGroup());
}
+ @Override
public void modelGroup(XSModelGroup group) {
for( XSParticle p : group.getChildren())
particle(p);
}
+ @Override
public void elementDecl(XSElementDecl decl) {
QName n = BGMBuilder.getName(decl);
@@ -156,23 +160,28 @@
}
}
+ @Override
protected CTypeRef toTypeRef(CElementPropertyInfo ep) {
// we don't allow a mapping to typeRef if the wildcard is present
throw new IllegalStateException();
}
+ @Override
protected void toElementRef(CReferencePropertyInfo prop) {
prop.setWildcard(mode);
}
+ @Override
protected RawTypeSet.Mode canBeType(RawTypeSet parent) {
return RawTypeSet.Mode.MUST_BE_REFERENCE;
}
+ @Override
protected boolean isListOfValues() {
return false;
}
+ @Override
protected ID id() {
return ID.NONE;
}
@@ -190,14 +199,17 @@
this.target = target;
}
+ @Override
protected CTypeRef toTypeRef(CElementPropertyInfo ep) {
return new CTypeRef(target,decl);
}
+ @Override
protected void toElementRef(CReferencePropertyInfo prop) {
prop.getElements().add(target);
}
+ @Override
protected RawTypeSet.Mode canBeType(RawTypeSet parent) {
// if element substitution can occur, no way it can be mapped to a list of types
if(decl.getSubstitutables().size()>1)
@@ -206,10 +218,12 @@
return RawTypeSet.Mode.SHOULD_BE_TYPEREF;
}
+ @Override
protected boolean isListOfValues() {
return false;
}
+ @Override
protected ID id() {
return ID.NONE;
}
@@ -227,6 +241,7 @@
this.target = target;
}
+ @Override
protected CTypeRef toTypeRef(CElementPropertyInfo ep) {
assert !target.isCollection();
CAdapter a = target.getProperty().getAdapter();
@@ -235,10 +250,12 @@
return new CTypeRef(target.getContentType(),decl);
}
+ @Override
protected void toElementRef(CReferencePropertyInfo prop) {
prop.getElements().add(target);
}
+ @Override
protected RawTypeSet.Mode canBeType(RawTypeSet parent) {
// if element substitution can occur, no way it can be mapped to a list of types
if(decl.getSubstitutables().size()>1)
@@ -268,10 +285,12 @@
return RawTypeSet.Mode.SHOULD_BE_TYPEREF;
}
+ @Override
protected boolean isListOfValues() {
return target.getProperty().isValueList();
}
+ @Override
protected ID id() {
return target.getProperty().id();
}
@@ -298,6 +317,7 @@
target = r;
}
+ @Override
protected CTypeRef toTypeRef(CElementPropertyInfo ep) {
if(ep!=null && target.getAdapterUse()!=null)
ep.setAdapter(target.getAdapterUse());
@@ -311,6 +331,7 @@
*
* This method generates such an element class and returns it.
*/
+ @Override
protected void toElementRef(CReferencePropertyInfo prop) {
CClassInfo scope = Ring.get(ClassSelector.class).getCurrentBean();
Model model = Ring.get(Model.class);
@@ -331,6 +352,7 @@
}
}
+ @Override
protected RawTypeSet.Mode canBeType(RawTypeSet parent) {
// if we have an adapter or IDness, which requires special
// annotation, and there's more than one element,
@@ -348,10 +370,12 @@
return RawTypeSet.Mode.SHOULD_BE_TYPEREF;
}
+ @Override
protected boolean isListOfValues() {
return target.isCollection();
}
+ @Override
protected ID id() {
return target.idUse();
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/RefererFinder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/RefererFinder.java
index b8893c7..850e70c 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/RefererFinder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/RefererFinder.java
@@ -63,6 +63,7 @@
}
}
+ @Override
public void schema(XSSchema xs) {
if(!visited.add(xs)) return;
@@ -75,6 +76,7 @@
}
}
+ @Override
public void elementDecl(XSElementDecl e) {
if(!visited.add(e)) return;
@@ -82,6 +84,7 @@
e.getType().visit(this);
}
+ @Override
public void complexType(XSComplexType ct) {
if(!visited.add(ct)) return;
@@ -90,12 +93,14 @@
ct.getContentType().visit(this);
}
+ @Override
public void modelGroupDecl(XSModelGroupDecl decl) {
if(!visited.add(decl)) return;
modelGroup(decl.getModelGroup());
}
+ @Override
public void modelGroup(XSModelGroup group) {
if(!visited.add(group)) return;
@@ -104,6 +109,7 @@
}
}
+ @Override
public void particle(XSParticle particle) {
// since the particle method is side-effect free, no need to check for double-visit.
particle.getTerm().visit(this);
@@ -111,16 +117,27 @@
// things we don't care
+ @Override
public void simpleType(XSSimpleType simpleType) {}
+ @Override
public void annotation(XSAnnotation ann) {}
+ @Override
public void attGroupDecl(XSAttGroupDecl decl) {}
+ @Override
public void attributeDecl(XSAttributeDecl decl) {}
+ @Override
public void attributeUse(XSAttributeUse use) {}
+ @Override
public void facet(XSFacet facet) {}
+ @Override
public void notation(XSNotation notation) {}
+ @Override
public void identityConstraint(XSIdentityConstraint decl) {}
+ @Override
public void xpath(XSXPath xp) {}
+ @Override
public void wildcard(XSWildcard wc) {}
+ @Override
public void empty(XSContentType empty) {}
/**
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/SimpleTypeBuilder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/SimpleTypeBuilder.java
index 8298f33..3ebb7b0 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/SimpleTypeBuilder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/SimpleTypeBuilder.java
@@ -69,6 +69,8 @@
import org.xml.sax.Locator;
+import javax.xml.XMLConstants;
+
/**
* Builds {@link TypeUse} from simple types.
*
@@ -272,6 +274,7 @@
public final XSSimpleTypeFunction<TypeUse> composer = new XSSimpleTypeFunction<TypeUse>() {
+ @Override
public TypeUse listSimpleType(XSListSimpleType type) {
// bind item type individually and then compose them into a list
// facets on the list shouldn't be taken account when binding item types,
@@ -283,6 +286,7 @@
return tu;
}
+ @Override
public TypeUse unionSimpleType(XSUnionSimpleType type) {
boolean isCollection = false;
for (int i = 0; i < type.getMemberSize(); i++)
@@ -297,6 +301,7 @@
return r;
}
+ @Override
public TypeUse restrictionSimpleType(XSRestrictionSimpleType type) {
// just process the base type.
return compose(type.getSimpleBaseType());
@@ -367,7 +372,7 @@
// if the type is built in, look for the default binding
- if(type.getTargetNamespace().equals(WellKnownNamespace.XML_SCHEMA)) {
+ if(XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(type.getTargetNamespace())) {
String name = type.getName();
if(name!=null) {
r = lookupBuiltin(name);
@@ -479,7 +484,7 @@
*/
public static boolean canBeMappedToTypeSafeEnum( XSSimpleType type ) {
do {
- if( WellKnownNamespace.XML_SCHEMA.equals(type.getTargetNamespace()) ) {
+ if( XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(type.getTargetNamespace()) ) {
// type must be derived from one of these types
String localName = type.getName();
if( localName!=null ) {
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/UnusedCustomizationChecker.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/UnusedCustomizationChecker.java
index ee323c9..6c013ec 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/UnusedCustomizationChecker.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/UnusedCustomizationChecker.java
@@ -134,23 +134,28 @@
}
+ @Override
public void annotation(XSAnnotation ann) {}
+ @Override
public void attGroupDecl(XSAttGroupDecl decl) {
if(check(decl))
attContainer(decl);
}
+ @Override
public void attributeDecl(XSAttributeDecl decl) {
if(check(decl))
decl.getType().visit((XSSimpleTypeVisitor)this);
}
+ @Override
public void attributeUse(XSAttributeUse use) {
if(check(use))
use.getDecl().visit(this);
}
+ @Override
public void complexType(XSComplexType type) {
if(check(type)) {
// don't need to check the base type -- it must be global, thus
@@ -171,27 +176,33 @@
if(wc!=null) wc.visit(this);
}
+ @Override
public void schema(XSSchema schema) {
check(schema);
}
+ @Override
public void facet(XSFacet facet) {
check(facet);
}
+ @Override
public void notation(XSNotation notation) {
check(notation);
}
+ @Override
public void wildcard(XSWildcard wc) {
check(wc);
}
+ @Override
public void modelGroupDecl(XSModelGroupDecl decl) {
if(check(decl))
decl.getModelGroup().visit(this);
}
+ @Override
public void modelGroup(XSModelGroup group) {
if(check(group)) {
for( int i=0; i<group.getSize(); i++ )
@@ -199,6 +210,7 @@
}
}
+ @Override
public void elementDecl(XSElementDecl decl) {
if(check(decl)) {
decl.getType().visit(this);
@@ -207,30 +219,36 @@
}
}
+ @Override
public void simpleType(XSSimpleType simpleType) {
if(check(simpleType))
simpleType.visit( (XSSimpleTypeVisitor)this );
}
+ @Override
public void particle(XSParticle particle) {
if(check(particle))
particle.getTerm().visit(this);
}
+ @Override
public void empty(XSContentType empty) {
check(empty);
}
+ @Override
public void listSimpleType(XSListSimpleType type) {
if(check(type))
type.getItemType().visit((XSSimpleTypeVisitor)this);
}
+ @Override
public void restrictionSimpleType(XSRestrictionSimpleType type) {
if(check(type))
type.getBaseType().visit(this);
}
+ @Override
public void unionSimpleType(XSUnionSimpleType type) {
if(check(type)) {
for( int i=0; i<type.getMemberSize(); i++ )
@@ -238,6 +256,7 @@
}
}
+ @Override
public void identityConstraint(XSIdentityConstraint id) {
if(check(id)) {
id.getSelector().visit(this);
@@ -246,6 +265,7 @@
}
}
+ @Override
public void xpath(XSXPath xp) {
check(xp);
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/WildcardNameClassBuilder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/WildcardNameClassBuilder.java
index 40af7dc..a944213 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/WildcardNameClassBuilder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/WildcardNameClassBuilder.java
@@ -39,10 +39,12 @@
return wc.apply(theInstance);
}
+ @Override
public NameClass any(XSWildcard.Any wc) {
return NameClass.ANY;
}
+ @Override
public NameClass other(XSWildcard.Other wc) {
return new AnyNameExceptNameClass(
new ChoiceNameClass(
@@ -50,6 +52,7 @@
new NsNameClass(wc.getOtherNamespace())));
}
+ @Override
public NameClass union(XSWildcard.Union wc) {
NameClass nc = null;
for (Iterator itr = wc.iterateNamespaces(); itr.hasNext();) {
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/AnnotationParserFactoryImpl.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/AnnotationParserFactoryImpl.java
index 3c4d088..cdd1f40 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/AnnotationParserFactoryImpl.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/AnnotationParserFactoryImpl.java
@@ -50,12 +50,14 @@
*/
private ValidatorHandler validator;
+ @Override
public AnnotationParser create() {
return new AnnotationParser() {
private Unmarshaller u = BindInfo.getCustomizationUnmarshaller();
private UnmarshallerHandler handler;
+ @Override
public ContentHandler getContentHandler(
AnnotationContext context, String parentElementName,
final ErrorHandler errorHandler, EntityResolver entityResolver ) {
@@ -104,7 +106,8 @@
};
}
- public BindInfo getResult( Object existing ) {
+ @Override
+ public BindInfo getResult(Object existing ) {
if(handler==null)
// interface contract violation.
// the getContentHandler method must have been called.
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIConversion.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIConversion.java
index ea89efd..0b634e8 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIConversion.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIConversion.java
@@ -14,6 +14,8 @@
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlRootElement;
import jakarta.xml.bind.annotation.adapters.XmlAdapter;
+
+import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
import com.sun.codemodel.JClass;
@@ -74,6 +76,7 @@
*/
public abstract TypeUse getTypeUse( XSSimpleType owner );
+ @Override
public QName getName() { return NAME; }
/** Name of the conversion declaration. */
@@ -94,6 +97,7 @@
this.transducer = transducer;
}
+ @Override
public TypeUse getTypeUse(XSSimpleType owner) {
return transducer;
}
@@ -136,6 +140,7 @@
*/
private TypeUse typeUse;
+ @Override
public TypeUse getTypeUse(XSSimpleType owner) {
if(typeUse!=null)
return typeUse;
@@ -277,7 +282,7 @@
private String findBaseConversion(XSSimpleType owner) {
// find the base simple type mapping.
for( XSSimpleType st=owner; st!=null; st = st.getSimpleBaseType() ) {
- if( !WellKnownNamespace.XML_SCHEMA.equals(st.getTargetNamespace()) )
+ if( !XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(st.getTargetNamespace()) )
continue; // user-defined type
String name = st.getName().intern();
@@ -289,6 +294,7 @@
return null;
}
+ @Override
public QName getName() { return NAME; }
/** Name of the conversion declaration. */
@@ -306,6 +312,7 @@
private TypeUse typeUse;
+ @Override
public TypeUse getTypeUse(XSSimpleType owner) {
if(typeUse!=null)
return typeUse;
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIGlobalBinding.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIGlobalBinding.java
index 5b78dad..3d600b0 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIGlobalBinding.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIGlobalBinding.java
@@ -20,6 +20,8 @@
import jakarta.xml.bind.annotation.XmlEnumValue;
import jakarta.xml.bind.annotation.XmlRootElement;
import jakarta.xml.bind.annotation.XmlTransient;
+
+import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
import com.sun.codemodel.ClassType;
@@ -384,7 +386,7 @@
super.setParent(parent);
// fill in the remaining default values
if(enumBaseTypes==null)
- enumBaseTypes = Collections.singleton(new QName(WellKnownNamespace.XML_SCHEMA,"string"));
+ enumBaseTypes = Collections.singleton(new QName(XMLConstants.W3C_XML_SCHEMA_NS_URI,"string"));
this.defaultProperty = new BIProperty(getLocation(),null,null,null,
collectionType, fixedAttributeAsConstantProperty, optionalProperty, generateElementProperty );
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIProperty.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIProperty.java
index de3340d..969ee03 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIProperty.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BIProperty.java
@@ -578,14 +578,17 @@
* a fixed value constraint.
*/
private final XSFinder hasFixedValue = new XSFinder() {
+ @Override
public Boolean attributeDecl(XSAttributeDecl decl) {
return decl.getFixedValue()!=null;
}
+ @Override
public Boolean attributeUse(XSAttributeUse use) {
return use.getFixedValue()!=null;
}
+ @Override
public Boolean schema(XSSchema s) {
// we allow globalBindings to have isConstantProperty==true,
// so this method returns true to allow this.
@@ -666,73 +669,90 @@
private final static XSFunction<XSComponent> defaultCustomizationFinder = new XSFunction<XSComponent>() {
+ @Override
public XSComponent attributeUse(XSAttributeUse use) {
return use.getDecl(); // inherit from the declaration
}
+ @Override
public XSComponent particle(XSParticle particle) {
return particle.getTerm(); // inherit from the term
}
+ @Override
public XSComponent schema(XSSchema schema) {
// no more delegation
return null;
}
// delegates to the context schema object
+ @Override
public XSComponent attributeDecl(XSAttributeDecl decl) {
return decl.getOwnerSchema();
}
+ @Override
public XSComponent wildcard(XSWildcard wc) {
return wc.getOwnerSchema();
}
+ @Override
public XSComponent modelGroupDecl(XSModelGroupDecl decl) {
return decl.getOwnerSchema();
}
+ @Override
public XSComponent modelGroup(XSModelGroup group) {
return group.getOwnerSchema();
}
+ @Override
public XSComponent elementDecl(XSElementDecl decl) {
return decl.getOwnerSchema();
}
+ @Override
public XSComponent complexType(XSComplexType type) {
return type.getOwnerSchema();
}
+ @Override
public XSComponent simpleType(XSSimpleType st) {
return st.getOwnerSchema();
}
// property customizations are not allowed on these components.
+ @Override
public XSComponent attGroupDecl(XSAttGroupDecl decl) {
throw new IllegalStateException();
}
+ @Override
public XSComponent empty(XSContentType empty) {
throw new IllegalStateException();
}
+ @Override
public XSComponent annotation(XSAnnotation xsAnnotation) {
throw new IllegalStateException();
}
+ @Override
public XSComponent facet(XSFacet xsFacet) {
throw new IllegalStateException();
}
+ @Override
public XSComponent notation(XSNotation xsNotation) {
throw new IllegalStateException();
}
+ @Override
public XSComponent identityConstraint(XSIdentityConstraint x) {
throw new IllegalStateException();
}
+ @Override
public XSComponent xpath(XSXPath xsxPath) {
throw new IllegalStateException();
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BindInfo.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BindInfo.java
index 91c9f91..2ee45a6 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BindInfo.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/BindInfo.java
@@ -26,6 +26,8 @@
import jakarta.xml.bind.annotation.XmlMixed;
import jakarta.xml.bind.annotation.XmlRootElement;
import jakarta.xml.bind.annotation.XmlType;
+
+import javax.xml.XMLConstants;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.dom.DOMSource;
@@ -54,8 +56,8 @@
* @author
* Kohsuke Kawaguchi (kohsuke,kawaguchi@sun.com)
*/
-@XmlRootElement(namespace= WellKnownNamespace.XML_SCHEMA,name="annotation")
-@XmlType(namespace=WellKnownNamespace.XML_SCHEMA,name="foobar")
+@XmlRootElement(namespace= XMLConstants.W3C_XML_SCHEMA_NS_URI,name="annotation")
+@XmlType(namespace=XMLConstants.W3C_XML_SCHEMA_NS_URI,name="foobar")
public final class BindInfo implements Iterable<BIDeclaration> {
private BGMBuilder builder;
@@ -66,7 +68,7 @@
/**
* Documentation taken from {@code <xs:documentation>s}.
*/
- @XmlElement(namespace=WellKnownNamespace.XML_SCHEMA)
+ @XmlElement(namespace=XMLConstants.W3C_XML_SCHEMA_NS_URI)
private Documentation documentation;
/**
@@ -120,7 +122,7 @@
DomHandlerEx.DomAndLocation e = (DomHandlerEx.DomAndLocation)o;
String nsUri = e.element.getNamespaceURI();
if(nsUri==null || nsUri.equals("")
- || nsUri.equals(WellKnownNamespace.XML_SCHEMA))
+ || XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(nsUri))
continue; // this is definitely not a customization
bi.addDecl(new BIXPluginCustomization(e.element,e.loc));
}
@@ -130,7 +132,7 @@
// only used by JAXB
- @XmlElement(namespace=WellKnownNamespace.XML_SCHEMA)
+ @XmlElement(namespace=XMLConstants.W3C_XML_SCHEMA_NS_URI)
void setAppinfo(AppInfo aib) {
aib.addTo(this);
}
@@ -217,15 +219,18 @@
Writer fw = new FilterWriter(w) {
char[] buf = new char[1];
+ @Override
public void write(int c) throws IOException {
buf[0] = (char)c;
write(buf,0,1);
}
+ @Override
public void write(char[] cbuf, int off, int len) throws IOException {
MinimumEscapeHandler.theInstance.escape(cbuf,off,len,false,out);
}
+ @Override
public void write(String str, int off, int len) throws IOException {
write(str.toCharArray(),off,len);
}
@@ -262,6 +267,7 @@
public BIDeclaration get( int idx ) { return decls.get(idx); }
+ @Override
public Iterator<BIDeclaration> iterator() {
return decls.iterator();
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/ForkingFilter.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/ForkingFilter.java
index a3a8960..73bef18 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/ForkingFilter.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/bindinfo/ForkingFilter.java
@@ -20,6 +20,8 @@
import org.xml.sax.XMLFilter;
import org.xml.sax.helpers.XMLFilterImpl;
+import javax.xml.XMLConstants;
+
/**
* {@link XMLFilter} that can fork an event to another {@link ContentHandler}
* in the middle.
@@ -93,7 +95,7 @@
@Override
public void startPrefixMapping(String prefix, String uri) throws SAXException {
- if (WellKnownNamespace.XML_NAMESPACE_URI.equals(uri)) return; //xml prefix shall not be declared based on jdk api javadoc
+ if (XMLConstants.XML_NS_URI.equals(uri)) return; //xml prefix shall not be declared based on jdk api javadoc
if(side!=null)
side.startPrefixMapping(prefix,uri);
namespaces.add(prefix);
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/AbstractExtendedComplexTypeBuilder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/AbstractExtendedComplexTypeBuilder.java
index d6b1c79..0d6837c 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/AbstractExtendedComplexTypeBuilder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/AbstractExtendedComplexTypeBuilder.java
@@ -69,6 +69,7 @@
return nc;
}
+ @Override
public NameClass elementDecl(XSElementDecl decl) {
return getNameClass(decl);
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/FreshComplexTypeBuilder.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/FreshComplexTypeBuilder.java
index de67e16..aa7ccfb 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/FreshComplexTypeBuilder.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/ct/FreshComplexTypeBuilder.java
@@ -43,6 +43,7 @@
XSContentType contentType = ct.getContentType();
contentType.visit(new XSContentTypeVisitor() {
+ @Override
public void simpleType(XSSimpleType st) {
builder.recordBindingMode(ct,ComplexTypeBindingMode.NORMAL);
@@ -55,6 +56,7 @@
selector.getCurrentBean().addProperty(p);
}
+ @Override
public void particle(XSParticle p) {
// determine the binding of this complex type.
@@ -69,6 +71,7 @@
}
+ @Override
public void empty(XSContentType e) {
builder.recordBindingMode(ct,NORMAL);
}
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/CustomizationContextChecker.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/CustomizationContextChecker.java
index db8c949..49ed038 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/CustomizationContextChecker.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/CustomizationContextChecker.java
@@ -14,6 +14,7 @@
import java.util.Set;
import java.util.Stack;
+import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
import com.sun.tools.xjc.reader.Const;
@@ -139,7 +140,7 @@
QName newElement = new QName(namespaceURI,localName);
if( newElement.getNamespaceURI().equals(Const.JAXB_NSURI)
- && top().getNamespaceURI().equals(WellKnownNamespace.XML_SCHEMA) ) {
+ && XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(top().getNamespaceURI()) ) {
// we hit a JAXB customization. the stack top should be
// <xs:appinfo>
if( elementNames.size()>=3 ) {
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/IncorrectNamespaceURIChecker.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/IncorrectNamespaceURIChecker.java
index 8a976eb..75b196e 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/IncorrectNamespaceURIChecker.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/IncorrectNamespaceURIChecker.java
@@ -19,6 +19,8 @@
import org.xml.sax.SAXParseException;
import org.xml.sax.helpers.XMLFilterImpl;
+import javax.xml.XMLConstants;
+
/**
* This filter detects the use of incorrect JAXB namespace URI.
*
@@ -77,7 +79,7 @@
@Override
public void startPrefixMapping(String prefix, String uri) throws SAXException {
- if (WellKnownNamespace.XML_NAMESPACE_URI.equals(uri)) return; //xml prefix shall not be declared based on jdk api javadoc
+ if (XMLConstants.XML_NS_URI.equals(uri)) return; //xml prefix shall not be declared based on jdk api javadoc
if( prefix.equals("jaxb") )
isJAXBPrefixUsed = true;
if( uri.equals(Const.JAXB_NSURI) )
diff --git a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/XMLSchemaInternalizationLogic.java b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/XMLSchemaInternalizationLogic.java
index 1f2d953..0ed45a8 100644
--- a/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/XMLSchemaInternalizationLogic.java
+++ b/jaxb-ri/xjc/src/main/java/com/sun/tools/xjc/reader/xmlschema/parser/XMLSchemaInternalizationLogic.java
@@ -21,6 +21,8 @@
import org.xml.sax.Attributes;
import org.xml.sax.helpers.XMLFilterImpl;
+import javax.xml.XMLConstants;
+
/**
* XML Schema specific internalization logic.
*
@@ -40,7 +42,7 @@
@Override
protected String findExternalResource( String nsURI, String localName, Attributes atts) {
- if( WellKnownNamespace.XML_SCHEMA.equals(nsURI)
+ if( XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(nsURI)
&& ("import".equals(localName) || "include".equals(localName) ) )
return atts.getValue("schemaLocation");
else
@@ -55,19 +57,19 @@
@Override
public boolean checkIfValidTargetNode(DOMForest parent, Element bindings, Element target) {
- return WellKnownNamespace.XML_SCHEMA.equals(target.getNamespaceURI());
+ return XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(target.getNamespaceURI());
}
@Override
public Element refineTarget(Element target) {
// look for existing xs:annotation
- Element annotation = DOMUtils.getFirstChildElement(target, WellKnownNamespace.XML_SCHEMA, "annotation");
+ Element annotation = DOMUtils.getFirstChildElement(target, XMLConstants.W3C_XML_SCHEMA_NS_URI, "annotation");
if(annotation==null)
// none exists. need to make one
annotation = insertXMLSchemaElement( target, "annotation" );
// then look for appinfo
- Element appinfo = DOMUtils.getFirstChildElement(annotation, WellKnownNamespace.XML_SCHEMA, "appinfo" );
+ Element appinfo = DOMUtils.getFirstChildElement(annotation, XMLConstants.W3C_XML_SCHEMA_NS_URI, "appinfo" );
if(appinfo==null)
// none exists. need to make one
appinfo = insertXMLSchemaElement( annotation, "appinfo" );
@@ -90,7 +92,7 @@
if(idx==-1) qname = localName;
else qname = qname.substring(0,idx+1)+localName;
- Element child = parent.getOwnerDocument().createElementNS( WellKnownNamespace.XML_SCHEMA, qname );
+ Element child = parent.getOwnerDocument().createElementNS( XMLConstants.W3C_XML_SCHEMA_NS_URI, qname );
NodeList children = parent.getChildNodes();
diff --git a/jaxb-ri/xjc/src/test/java/com/sun/tools/xjc/api/Driver.java b/jaxb-ri/xjc/src/test/java/com/sun/tools/xjc/api/Driver.java
index 15be363..3a2b2a0 100644
--- a/jaxb-ri/xjc/src/test/java/com/sun/tools/xjc/api/Driver.java
+++ b/jaxb-ri/xjc/src/test/java/com/sun/tools/xjc/api/Driver.java
@@ -15,6 +15,7 @@
import java.util.ArrayList;
import java.util.List;
+import javax.xml.XMLConstants;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamConstants;
@@ -129,7 +130,7 @@
if( n.getNodeType()==Node.ELEMENT_NODE ) {
Element x = (Element)n;
if(x.getLocalName().equals("schema")
- && x.getNamespaceURI().equals(WellKnownNamespace.XML_SCHEMA))
+ && XMLConstants.W3C_XML_SCHEMA_NS_URI.equals(x.getNamespaceURI()))
return x;
x = findSchemas(x);