Mark stable and document libcore.util.XmlObjectFactory
Bug: 154796679
Test: m update-api
Change-Id: I2c15353ccf219339c32049c189884256120049ff
diff --git a/luni/src/main/java/libcore/util/XmlObjectFactory.java b/luni/src/main/java/libcore/util/XmlObjectFactory.java
index 3fafb39..ed8b1ac 100644
--- a/luni/src/main/java/libcore/util/XmlObjectFactory.java
+++ b/luni/src/main/java/libcore/util/XmlObjectFactory.java
@@ -28,7 +28,7 @@
*
* @hide
*/
-@libcore.api.CorePlatformApi
+@libcore.api.CorePlatformApi(status = libcore.api.CorePlatformApi.Status.STABLE)
public class XmlObjectFactory {
private XmlObjectFactory() {}
@@ -36,26 +36,32 @@
/**
* Returns a new instance of the platform default {@link XmlSerializer} more efficiently than
* using {@code XmlPullParserFactory.newInstance().newSerializer()}.
+ *
+ * @return platform default {@link XmlSerializer}
*/
- @libcore.api.CorePlatformApi
- public static XmlSerializer newXmlSerializer() {
+ @libcore.api.CorePlatformApi(status = libcore.api.CorePlatformApi.Status.STABLE)
+ public static @NonNull XmlSerializer newXmlSerializer() {
return new KXmlSerializer();
}
/**
* Returns a new instance of the platform default {@link XmlPullParser} more efficiently than
* using {@code XmlPullParserFactory.newInstance().newPullParser()}.
+ *
+ * @return platform default {@link XmlPullParser}
*/
- @libcore.api.CorePlatformApi
- public static XmlPullParser newXmlPullParser() {
+ @libcore.api.CorePlatformApi(status = libcore.api.CorePlatformApi.Status.STABLE)
+ public static @NonNull XmlPullParser newXmlPullParser() {
return new KXmlParser();
}
/**
* Returns the plaform default {@link XMLReader}.
+ *
+ * @return plaform default {@link XMLReader}
*/
- @libcore.api.CorePlatformApi
- public static XMLReader newXMLReader() {
+ @libcore.api.CorePlatformApi(status = libcore.api.CorePlatformApi.Status.STABLE)
+ public static @NonNull XMLReader newXMLReader() {
return new ExpatReader();
}
}
diff --git a/mmodules/core_platform_api/api/legacy_platform/current.txt b/mmodules/core_platform_api/api/legacy_platform/current.txt
index dd1e8ac..34c543a 100644
--- a/mmodules/core_platform_api/api/legacy_platform/current.txt
+++ b/mmodules/core_platform_api/api/legacy_platform/current.txt
@@ -765,9 +765,9 @@
}
public class XmlObjectFactory {
- method public static org.xml.sax.XMLReader newXMLReader();
- method public static org.xmlpull.v1.XmlPullParser newXmlPullParser();
- method public static org.xmlpull.v1.XmlSerializer newXmlSerializer();
+ method @NonNull public static org.xml.sax.XMLReader newXMLReader();
+ method @NonNull public static org.xmlpull.v1.XmlPullParser newXmlPullParser();
+ method @NonNull public static org.xmlpull.v1.XmlSerializer newXmlSerializer();
}
}
diff --git a/mmodules/core_platform_api/api/stable_platform/current.txt b/mmodules/core_platform_api/api/stable_platform/current.txt
index 4185e0e..885a188 100644
--- a/mmodules/core_platform_api/api/stable_platform/current.txt
+++ b/mmodules/core_platform_api/api/stable_platform/current.txt
@@ -635,6 +635,12 @@
method public static void sneakyThrow(@NonNull Throwable);
}
+ public class XmlObjectFactory {
+ method @NonNull public static org.xml.sax.XMLReader newXMLReader();
+ method @NonNull public static org.xmlpull.v1.XmlPullParser newXmlPullParser();
+ method @NonNull public static org.xmlpull.v1.XmlSerializer newXmlSerializer();
+ }
+
}
package sun.misc {