DEFAULT_XML_OPTIONS.setSaveSuggestedPrefixes(Collections.unmodifiableMap(map));\r
}\r
\r
- public static XmlObject newInstance(SchemaType type, XmlOptions options) {\r
+ private static XmlOptions getXmlOptions(XmlOptions options) {\r
XmlOptions opt = (options == null) ? DEFAULT_XML_OPTIONS : options;\r
- return XmlBeans.getContextTypeLoader().newInstance(type, opt);\r
+ return opt;\r
+ }\r
+\r
+ public static XmlObject newInstance(SchemaType type, XmlOptions options) {\r
+ return XmlBeans.getContextTypeLoader().newInstance(type, getXmlOptions(options));\r
}\r
\r
public static XmlObject parse(String xmlText, SchemaType type, XmlOptions options) throws XmlException {\r
- XmlOptions opt = (options == null) ? DEFAULT_XML_OPTIONS : options;\r
- return XmlBeans.getContextTypeLoader().parse(xmlText, type, opt);\r
+ return XmlBeans.getContextTypeLoader().parse(xmlText, type, getXmlOptions(options));\r
}\r
\r
public static XmlObject parse(File file, SchemaType type, XmlOptions options) throws XmlException, IOException {\r
- XmlOptions opt = (options == null) ? DEFAULT_XML_OPTIONS : options;\r
- return XmlBeans.getContextTypeLoader().parse(file, type, opt);\r
+ return XmlBeans.getContextTypeLoader().parse(file, type, getXmlOptions(options));\r
}\r
\r
public static XmlObject parse(URL file, SchemaType type, XmlOptions options) throws XmlException, IOException {\r
- XmlOptions opt = (options == null) ? DEFAULT_XML_OPTIONS : options;\r
- return XmlBeans.getContextTypeLoader().parse(file, type, opt);\r
+ return XmlBeans.getContextTypeLoader().parse(file, type, getXmlOptions(options));\r
}\r
\r
public static XmlObject parse(InputStream jiois, SchemaType type, XmlOptions options) throws XmlException, IOException {\r
- XmlOptions opt = (options == null) ? DEFAULT_XML_OPTIONS : options;\r
- return XmlBeans.getContextTypeLoader().parse(jiois, type, opt);\r
+ return XmlBeans.getContextTypeLoader().parse(jiois, type, getXmlOptions(options));\r
}\r
\r
public static XmlObject parse(XMLStreamReader xsr, SchemaType type, XmlOptions options) throws XmlException {\r
- XmlOptions opt = (options == null) ? DEFAULT_XML_OPTIONS : options;\r
- return XmlBeans.getContextTypeLoader().parse(xsr, type, opt);\r
+ return XmlBeans.getContextTypeLoader().parse(xsr, type, getXmlOptions(options));\r
}\r
\r
public static XmlObject parse(Reader jior, SchemaType type, XmlOptions options) throws XmlException, IOException {\r
- XmlOptions opt = (options == null) ? DEFAULT_XML_OPTIONS : options;\r
- return XmlBeans.getContextTypeLoader().parse(jior, type, opt);\r
+ return XmlBeans.getContextTypeLoader().parse(jior, type, getXmlOptions(options));\r
}\r
\r
public static XmlObject parse(Node node, SchemaType type, XmlOptions options) throws XmlException {\r
- XmlOptions opt = (options == null) ? DEFAULT_XML_OPTIONS : options;\r
- return XmlBeans.getContextTypeLoader().parse(node, type, opt);\r
+ return XmlBeans.getContextTypeLoader().parse(node, type, getXmlOptions(options));\r
}\r
\r
public static XmlObject parse(XMLInputStream xis, SchemaType type, XmlOptions options) throws XmlException, XMLStreamException {\r
- XmlOptions opt = (options == null) ? DEFAULT_XML_OPTIONS : options;\r
- return XmlBeans.getContextTypeLoader().parse(xis, type, opt);\r
+ return XmlBeans.getContextTypeLoader().parse(xis, type, getXmlOptions(options));\r
}\r
\r
public static XMLInputStream newValidatingXMLInputStream ( XMLInputStream xis, SchemaType type, XmlOptions options ) throws XmlException, XMLStreamException {\r
- XmlOptions opt = (options == null) ? DEFAULT_XML_OPTIONS : options;\r
- return XmlBeans.getContextTypeLoader().newValidatingXMLInputStream(xis, type, opt);\r
+ return XmlBeans.getContextTypeLoader().newValidatingXMLInputStream(xis, type, getXmlOptions(options));\r
}\r
}\r