You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by wl...@cleversafe.com on 2009/05/07 07:24:31 UTC

[PATCH 2 of 3] imported patch annotation-fixes.patch

# HG changeset patch
# User wleggette
# Date 1241673411 18000
# Node ID a1a0fd69fc89eb1a13b01ac96364ce5caba51b35
# Parent  0540c66e9de4596f52f6efd968f94a8bce70db6b
imported patch annotation-fixes.patch

diff -r 0540c66e9de4 -r a1a0fd69fc89 src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java
--- a/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java	Thu May 07 00:14:26 2009 -0500
+++ b/src/typeimpl/org/apache/xmlbeans/impl/schema/SchemaTypeCodePrinter.java	Thu May 07 00:16:51 2009 -0500
@@ -463,15 +463,21 @@
         }
 
         // Only need newInstance() for non-abstract types
-        if (sType.isAbstract())
+        if (sType.isAbstract()) {
             emit("/** @deprecated No need to be able to create instances of abstract types */");
+            if (_useJava15)
+                emit("@Deprecated");
+        }
         emit("public static " + fullName + " newInstance() {");
         emit("  return (" + fullName + ") org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, null ); }");
         emit("");
 
         // Only need newInstance() for non-abstract types
-        if (sType.isAbstract())
+        if (sType.isAbstract()) {
             emit("/** @deprecated No need to be able to create instances of abstract types */");
+            if (_useJava15)
+                emit("@Deprecated");
+        }
         emit("public static " + fullName + " newInstance(org.apache.xmlbeans.XmlOptions options) {");
         emit("  return (" + fullName + ") org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance( type, options ); }");
         emit("");
@@ -537,23 +543,31 @@
             emit("");
 
             emit("/** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */");
+            if (_useJava15)
+                emit("@Deprecated");
             emit("public static " + fullName + " parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {");
             emit("  return (" + fullName + ") org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xis, type, null ); }");
             emit("");
 
             emit("/** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */");
+            if (_useJava15)
+                emit("@Deprecated");
             emit("public static " + fullName + " parse(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {");
             emit("  return (" + fullName + ") org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse( xis, type, options ); }");
             emit("");
 
             // Don't have XMLInputStream anymore
             emit("/** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */");
+            if (_useJava15)
+                emit("@Deprecated");
             emit("public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {");
             emit("  return org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, null ); }");
             emit("");
 
             // Don't have XMLInputStream anymore
             emit("/** @deprecated {@link org.apache.xmlbeans.xml.stream.XMLInputStream} */");
+            if (_useJava15)
+                emit("@Deprecated");
             emit("public static org.apache.xmlbeans.xml.stream.XMLInputStream newValidatingXMLInputStream(org.apache.xmlbeans.xml.stream.XMLInputStream xis, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException, org.apache.xmlbeans.xml.stream.XMLStreamException {");
             emit("  return org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newValidatingXMLInputStream( xis, type, options ); }");
             emit("");
@@ -713,8 +727,12 @@
                     emit("java.math.BigInteger getBigIntegerValue();");
                     emit("void setBigIntegerValue(java.math.BigInteger bi);");
                     emit("/** @deprecated */");
+                    if (_useJava15)
+                        emit("@Deprecated");
                     emit("java.math.BigInteger bigIntegerValue();");
                     emit("/** @deprecated */");
+                    if (_useJava15)
+                        emit("@Deprecated");
                     emit("void set(java.math.BigInteger bi);");
                 }
                 else if (bits == SchemaType.SIZE_LONG)
@@ -722,8 +740,12 @@
                     emit("long getLongValue();");
                     emit("void setLongValue(long l);");
                     emit("/** @deprecated */");
+                    if (_useJava15)
+                        emit("@Deprecated");
                     emit("long longValue();");
                     emit("/** @deprecated */");
+                    if (_useJava15)
+                        emit("@Deprecated");
                     emit("void set(long l);");
                 }
                 else if (bits == SchemaType.SIZE_INT)
@@ -731,8 +753,12 @@
                     emit("int getIntValue();");
                     emit("void setIntValue(int i);");
                     emit("/** @deprecated */");
+                    if (_useJava15)
+                        emit("@Deprecated");
                     emit("int intValue();");
                     emit("/** @deprecated */");
+                    if (_useJava15)
+                        emit("@Deprecated");
                     emit("void set(int i);");
                 }
                 else if (bits == SchemaType.SIZE_SHORT)
@@ -740,8 +766,12 @@
                     emit("short getShortValue();");
                     emit("void setShortValue(short s);");
                     emit("/** @deprecated */");
+                    if (_useJava15)
+                        emit("@Deprecated");
                     emit("short shortValue();");
                     emit("/** @deprecated */");
+                    if (_useJava15)
+                        emit("@Deprecated");
                     emit("void set(short s);");
                 }
                 else if (bits == SchemaType.SIZE_BYTE)
@@ -749,8 +779,12 @@
                     emit("byte getByteValue();");
                     emit("void setByteValue(byte b);");
                     emit("/** @deprecated */");
+                    if (_useJava15)
+                        emit("@Deprecated");
                     emit("byte byteValue();");
                     emit("/** @deprecated */");
+                    if (_useJava15)
+                        emit("@Deprecated");
                     emit("void set(byte b);");
                 }
             }
@@ -761,8 +795,12 @@
             emit("java.lang.Object getObjectValue();");
             emit("void setObjectValue(java.lang.Object val);");
             emit("/** @deprecated */");
+            if (_useJava15)
+                emit("@Deprecated");
             emit("java.lang.Object objectValue();");
             emit("/** @deprecated */");
+            if (_useJava15)
+                emit("@Deprecated");
             emit("void objectSet(java.lang.Object val);");
             emit("org.apache.xmlbeans.SchemaType instanceType();");
             SchemaType ctype = sType.getUnionCommonBaseType();
@@ -776,10 +814,16 @@
             emit("java.util.List xgetListValue();");
             emit("void setListValue(java.util.List list);");
             emit("/** @deprecated */");
+            if (_useJava15)
+                emit("@Deprecated");
             emit("java.util.List listValue();");
             emit("/** @deprecated */");
+            if (_useJava15)
+                emit("@Deprecated");
             emit("java.util.List xlistValue();");
             emit("/** @deprecated */");
+            if (_useJava15)
+                emit("@Deprecated");
             emit("void set(java.util.List list);");
         }
     }
@@ -1149,6 +1193,7 @@
                 emit(" * Gets array of all " + propdesc + "s");
                 emit(" * @deprecated");
                 emit(" */");
+                emit("@Deprecated");
             }
             else
                 printJavaDoc("Gets array of all " + propdesc + "s");
@@ -1172,6 +1217,7 @@
                     emit(" * Gets (as xml) array of all " + propdesc + "s");
                     emit(" * @deprecated");
                     emit(" */");
+                    emit("@Deprecated");
                 }
                 else
                     printJavaDoc("Gets (as xml) array of all " + propdesc + "s");
@@ -2136,6 +2182,7 @@
                 emit(" * Gets array of all " + propdesc + "s");
                 emit(" * @deprecated");
                 emit(" */");
+                emit("@Deprecated");
             }
             else
                 printJavaDoc("Gets array of all " + propdesc + "s");
@@ -2181,6 +2228,7 @@
                     emit(" * Gets array of all " + propdesc + "s");
                     emit(" * @deprecated");
                     emit(" */");
+                    emit("@Deprecated");
                 }
                 else
                     printJavaDoc("Gets (as xml) array of all " + propdesc + "s");

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org