/** Used to set a generic option */ public void put ( Object option ) { put( option, null ); } /** Used to set a generic option */
/** Used to set a generic option */ public void put ( Object option, int value ) { put( option, new Integer( value ) ); }
private static XmlOptions makeInnerOptions(XmlOptions options) { XmlOptions innerOptions = new XmlOptions( options ); innerOptions.put( XmlOptions.SAVE_INNER ); return innerOptions; }
public XmlObject parse ( File file, SchemaType type, XmlOptions options ) throws XmlException, IOException { if (options == null) { options = new XmlOptions(); options.put( XmlOptions.DOCUMENT_SOURCE_NAME, file.toURI().normalize().toString() ); } else if (! options.hasOption(XmlOptions.DOCUMENT_SOURCE_NAME)) { options = new XmlOptions( options ); options.put( XmlOptions.DOCUMENT_SOURCE_NAME, file.toURI().normalize().toString() ); } InputStream fis = new FileInputStream( file ); try { return parse( fis, type, options ); } finally { fis.close(); } }
XmlSaxHandlerImpl(Locale l, SchemaType type, XmlOptions options) { super(null); _options = options; _type = type; // Because SAX loading is not atomic with respect to XmlBeans, I can't use the default // thread local CharUtil. Instruct the SaxHandler (and the LoadContext, eventually) // to use the Locale specific CharUtil. XmlOptions saxHandlerOptions = new XmlOptions(options); saxHandlerOptions.put(Cur.LOAD_USE_LOCALE_CHAR_UTIL); initSaxHandler(l, saxHandlerOptions); }
private static Locale newLocale ( Saaj saaj ) { XmlOptions options = null; if (saaj != null) { options = new XmlOptions(); options.put( org.apache.xmlbeans.impl.store.Saaj.SAAJ_IMPL, saaj ); } return Locale.getLocale( null, options ); }
public static String createSampleForType(SchemaType sType) { XmlObject object = XmlObject.Factory.newInstance(); XmlCursor cursor = object.newCursor(); // Skip the document node cursor.toNextToken(); // Using the type and the cursor, call the utility method to get a // sample XML payload for that Schema element new SampleXmlUtil(false).createSampleForType(sType, cursor); // Cursor now contains the sample payload // Pretty print the result. Note that the cursor is positioned at the // end of the doc so we use the original xml object that the cursor was // created upon to do the xmlText() against. XmlOptions options = new XmlOptions(); options.put(XmlOptions.SAVE_PRETTY_PRINT); options.put(XmlOptions.SAVE_PRETTY_PRINT_INDENT, 2); options.put(XmlOptions.SAVE_AGGRESSIVE_NAMESPACES); String result = object.xmlText(options); return result; }
schemaOptions.setCompileNoUpaRule(); if (partial) schemaOptions.put("COMPILE_PARTIAL_TYPESYSTEM");
schemaOptions.setCompileNoUpaRule(); if (partial) schemaOptions.put("COMPILE_PARTIAL_TYPESYSTEM");
options.put( XmlOptions.LOAD_LINE_NUMBERS ); options.setEntityResolver(entResolver); options.setLoadSubstituteNamespaces(MAP_COMPATIBILITY_CONFIG_URIS);
private static XmlOptions makeInnerOptions(XmlOptions options) { XmlOptions innerOptions = new XmlOptions( options ); innerOptions.put( XmlOptions.SAVE_INNER ); return innerOptions; }
public void afterPropertiesSet() throws Exception { xmlOptions = new XmlOptions(); if (options != null) { for (Iterator iterator = options.keySet().iterator(); iterator.hasNext();) { Object option = iterator.next(); xmlOptions.put(option, options.get(option)); } } } }
XmlSaxHandlerImpl(Locale l, SchemaType type, XmlOptions options) { super(null); _options = options; _type = type; // Because SAX loading is not atomic with respect to XmlBeans, I can't use the default // thread local CharUtil. Instruct the SaxHandler (and the LoadContext, eventually) // to use the Locale specific CharUtil. XmlOptions saxHandlerOptions = new XmlOptions(options); saxHandlerOptions.put(Cur.LOAD_USE_LOCALE_CHAR_UTIL); initSaxHandler(l, saxHandlerOptions); }
private static Locale newLocale ( Saaj saaj ) { XmlOptions options = null; if (saaj != null) { options = new XmlOptions(); options.put( org.apache.xmlbeans.impl.store.Saaj.SAAJ_IMPL, saaj ); } return Locale.getLocale( null, options ); }
private static Locale newLocale ( Saaj saaj ) { XmlOptions options = null; if (saaj != null) { options = new XmlOptions(); options.put( org.apache.xmlbeans.impl.store.Saaj.SAAJ_IMPL, saaj ); } return Locale.getLocale( null, options ); }
opt.put(XmlOptions.VALIDATE_TEXT_ONLY); if (!val.validate(opt)) throw new Exception();
options.put(XmlOptions.LOAD_ADDITIONAL_NAMESPACES, namespaces);