/** * Delegates to SchemaParsingConfig.setProperty. * @param propertyId * @param value */ public void setProperty(String propertyId, Object value){ config.setProperty(propertyId, value); }
/** * @see org.apache.xerces.xni.parser.XMLParserConfiguration#setProperty(java.lang.String, java.lang.Object) */ @Override public void setProperty(String propertyId, Object value) throws XMLConfigurationException { config.setProperty(propertyId, value); }
/** * Constructs a document parser using the specified symbol table and * grammar pool. */ public XMLDocumentParser(SymbolTable symbolTable, XMLGrammarPool grammarPool) { super((XMLParserConfiguration)ObjectFactory.createObject( "org.apache.xerces.xni.parser.XMLParserConfiguration", "org.apache.xerces.parsers.XIncludeAwareParserConfiguration" )); fConfiguration.setProperty(Constants.XERCES_PROPERTY_PREFIX+Constants.SYMBOL_TABLE_PROPERTY, symbolTable); fConfiguration.setProperty(Constants.XERCES_PROPERTY_PREFIX+Constants.XMLGRAMMAR_POOL_PROPERTY, grammarPool); }
/** * Constructs a DOM Builder using the specified symbol table and * grammar pool. */ public DOMParserImpl (SymbolTable symbolTable, XMLGrammarPool grammarPool) { this ( (XMLParserConfiguration) ObjectFactory.createObject ( "org.apache.xerces.xni.parser.XMLParserConfiguration", "org.apache.xerces.parsers.XIncludeAwareParserConfiguration")); fConfiguration.setProperty ( Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY, symbolTable); fConfiguration.setProperty ( Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY, grammarPool); }
/** * Constructs a DOM Builder using the specified symbol table. */ public DOMParserImpl (SymbolTable symbolTable) { this ( (XMLParserConfiguration) ObjectFactory.createObject ( "org.apache.xerces.xni.parser.XMLParserConfiguration", "org.apache.xerces.parsers.XIncludeAwareParserConfiguration")); fConfiguration.setProperty ( Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY, symbolTable); } // <init>(SymbolTable)
/** * Constructs a document parser using the specified symbol table. */ public XMLDocumentParser(SymbolTable symbolTable) { super((XMLParserConfiguration)ObjectFactory.createObject( "org.apache.xerces.xni.parser.XMLParserConfiguration", "org.apache.xerces.parsers.XIncludeAwareParserConfiguration" )); fConfiguration.setProperty(Constants.XERCES_PROPERTY_PREFIX+Constants.SYMBOL_TABLE_PROPERTY, symbolTable); } // <init>(SymbolTable)
/** * Construct an XMLGrammarParser with the specified symbol table * * @param symbolTable */ protected XMLGrammarParser(SymbolTable symbolTable) { super((XMLParserConfiguration)ObjectFactory.createObject( "org.apache.xerces.xni.parser.XMLParserConfiguration", "org.apache.xerces.parsers.XIncludeAwareParserConfiguration" )); fConfiguration.setProperty(Constants.XERCES_PROPERTY_PREFIX+Constants.SYMBOL_TABLE_PROPERTY, symbolTable); }
public RaveDomParser(boolean sourceDocument) { // I had tried just calling this on the domParser field of the // document builder impl, but it's not accessible so I had to // create my own parser subclass if (sourceDocument) { setDocumentClassName("org.netbeans.modules.visualweb.designer.markup.RaveSourceDocument"); fConfiguration.setProperty (DOCUMENT_CLASS_NAME, "org.netbeans.modules.visualweb.designer.markup.RaveSourceDocument"); } else { // XXX render document setDocumentClassName("org.netbeans.modules.visualweb.designer.markup.RaveRenderedDocument"); fConfiguration.setProperty (DOCUMENT_CLASS_NAME, "org.netbeans.modules.visualweb.designer.markup.RaveRenderedDocument"); } // Enable dtd/grammar caching so we don't keep processing the // entity DTD declaration //fConfiguration.setProperty(XMLGRAMMAR_POOL, grammarPool); }
/** * Constructs a DOM parser using the specified symbol table and * grammar pool. */ public DOMParser(SymbolTable symbolTable, XMLGrammarPool grammarPool) { super((XMLParserConfiguration)ObjectFactory.createObject( "org.apache.xerces.xni.parser.XMLParserConfiguration", "org.apache.xerces.parsers.XIncludeAwareParserConfiguration" )); // set properties fConfiguration.addRecognizedProperties(RECOGNIZED_PROPERTIES); if (symbolTable != null) { fConfiguration.setProperty(SYMBOL_TABLE, symbolTable); } if (grammarPool != null) { fConfiguration.setProperty(XMLGRAMMAR_POOL, grammarPool); } } // <init>(SymbolTable,XMLGrammarPool)
/** * Constructs a DOM Builder using the standard parser configuration. */ public DOMParserImpl (String configuration, String schemaType) { this ( (XMLParserConfiguration) ObjectFactory.createObject ( "org.apache.xerces.xni.parser.XMLParserConfiguration", configuration)); if (schemaType != null) { if (schemaType.equals (Constants.NS_DTD)) { //Schema validation is false by default and hence there is no //need to set it to false here. Also, schema validation is //not a recognized feature for DTDConfiguration's and so //setting this feature here would result in a Configuration //Exception. fConfiguration.setProperty ( Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE, Constants.NS_DTD); fSchemaType = Constants.NS_DTD; } else if (schemaType.equals (Constants.NS_XMLSCHEMA)) { // XML Schem validation fConfiguration.setProperty ( Constants.JAXP_PROPERTY_PREFIX + Constants.SCHEMA_LANGUAGE, Constants.NS_XMLSCHEMA); } } }
/** * Constructs a SAX parser using the specified symbol table and * grammar pool. */ public SAXParser(SymbolTable symbolTable, XMLGrammarPool grammarPool) { super((XMLParserConfiguration)ObjectFactory.createObject( "org.apache.xerces.xni.parser.XMLParserConfiguration", "org.apache.xerces.parsers.XIncludeAwareParserConfiguration" )); // set features fConfiguration.addRecognizedFeatures(RECOGNIZED_FEATURES); fConfiguration.setFeature(NOTIFY_BUILTIN_REFS, true); // set properties fConfiguration.addRecognizedProperties(RECOGNIZED_PROPERTIES); if (symbolTable != null) { fConfiguration.setProperty(SYMBOL_TABLE, symbolTable); } if (grammarPool != null) { fConfiguration.setProperty(XMLGRAMMAR_POOL, grammarPool); } } // <init>(SymbolTable,XMLGrammarPool)
fConfiguration.setProperty(ENTITY_RESOLVER, new EntityResolver2Wrapper((EntityResolver2) resolver)); fConfiguration.setProperty(ENTITY_RESOLVER, new EntityResolverWrapper(resolver));
fConfiguration.setProperty(ERROR_HANDLER, new ErrorHandlerWrapper(errorHandler));
/** * Associate an <code>ASModel</code> with a document instance. This * <code>ASModel</code> will be used by the " * <code>validate-if-schema</code>" and " * <code>datatype-normalization</code>" options during the load of a new * <code>Document</code>. */ public void setAbstractSchema(ASModel abstractSchema) { // since the ASModel associated with this object is an attribute // according to the DOM IDL, we must obliterate anything // that was set before, rather than adding to it. // REVISIT: so shouldn't we attempt to clear the // grammarPool before adding stuff to it? - NG fAbstractSchema = (ASModelImpl)abstractSchema; // make sure the GrammarPool is properly initialized. XMLGrammarPool grammarPool = (XMLGrammarPool)fConfiguration.getProperty(StandardParserConfiguration.XMLGRAMMAR_POOL); // if there is no grammar pool, create one // REVISIT: ASBuilder should always create one. if (grammarPool == null) { // something's not right in this situation... grammarPool = new XMLGrammarPoolImpl(); fConfiguration.setProperty(StandardParserConfiguration.XMLGRAMMAR_POOL, grammarPool); } if (fAbstractSchema != null) { initGrammarPool(fAbstractSchema, grammarPool); } }
/** * Set the value of any property in a SAX2 parser. The parser might not recognize the property, * and if it does recognize it, it might not support the requested value. * * @param propertyId The unique identifier (URI) of the property being set. * @param value The value to which the property is being set. * @throws SAXNotRecognizedException If the requested property is not known. * @throws SAXNotSupportedException If the requested property is known, but the requested * value is not supported. */ public void setProperty(String propertyId, Object value) throws SAXNotRecognizedException, SAXNotSupportedException { try { fParserConfiguration.setProperty(propertyId, value); } catch (XMLConfigurationException e) { String message = e.getMessage(); if (e.getType() == XMLConfigurationException.NOT_RECOGNIZED) { throw new SAXNotRecognizedException(message); } else { throw new SAXNotSupportedException(message); } } } // setProperty(String,Object)
/** * Set the value of any property in a SAX2 parser. The parser might not recognize the property, * and if it does recognize it, it might not support the requested value. * * @param propertyId The unique identifier (URI) of the property being set. * @param value The value to which the property is being set. * @throws SAXNotRecognizedException If the requested property is not known. * @throws SAXNotSupportedException If the requested property is known, but the requested * value is not supported. */ public void setProperty(String propertyId, Object value) throws SAXNotRecognizedException, SAXNotSupportedException { try { fParserConfiguration.setProperty(propertyId, value); } catch (XMLConfigurationException e) { String message = e.getMessage(); if (e.getType() == XMLConfigurationException.NOT_RECOGNIZED) { throw new SAXNotRecognizedException(message); } else { throw new SAXNotSupportedException(message); } } } // setProperty(String,Object)
/** * Set the value of any property in a SAX2 parser. The parser * might not recognize the property, and if it does recognize * it, it might not support the requested value. * * @param propertyId The unique identifier (URI) of the property * being set. * @param value The value to which the property is being set. * * @exception SAXNotRecognizedException If the * requested property is not known. * @exception SAXNotSupportedException If the * requested property is known, but the requested * value is not supported. */ public void setProperty(String propertyId, Object value) throws SAXNotRecognizedException, SAXNotSupportedException { try { fParserConfiguration.setProperty(propertyId, value); } catch (XMLConfigurationException e) { String message = e.getMessage(); if (e.getType() == XMLConfigurationException.NOT_RECOGNIZED) { throw new SAXNotRecognizedException(message); } throw new SAXNotSupportedException(message); } } // setProperty(String,Object)
/** * Set the value of any property in a SAX2 parser. The parser * might not recognize the property, and if it does recognize * it, it might not support the requested value. * * @param propertyId The unique identifier (URI) of the property * being set. * @param value The value to which the property is being set. * * @exception SAXNotRecognizedException If the * requested property is not known. * @exception SAXNotSupportedException If the * requested property is known, but the requested * value is not supported. */ public void setProperty(String propertyId, Object value) throws SAXNotRecognizedException, SAXNotSupportedException { try { fParserConfiguration.setProperty(propertyId, value); } catch (final XMLConfigurationException e) { final String message = e.getMessage(); if (e.getType() == XMLConfigurationException.NOT_RECOGNIZED) { throw new SAXNotRecognizedException(message); } throw new SAXNotSupportedException(message); } }
/** * Set the value of any property in a SAX2 parser. The parser * might not recognize the property, and if it does recognize * it, it might not support the requested value. * * @param propertyId The unique identifier (URI) of the property * being set. * @param value The value to which the property is being set. * * @exception SAXNotRecognizedException If the * requested property is not known. * @exception SAXNotSupportedException If the * requested property is known, but the requested * value is not supported. */ public void setProperty(String propertyId, Object value) throws SAXNotRecognizedException, SAXNotSupportedException { try { fParserConfiguration.setProperty(propertyId, value); } catch (XMLConfigurationException e) { String message = e.getMessage(); if (e.getType() == XMLConfigurationException.NOT_RECOGNIZED) { throw new SAXNotRecognizedException(message); } else { throw new SAXNotSupportedException(message); } } } // setProperty(String,Object)
/** Default constructor. */ protected AbstractDOMParser (XMLParserConfiguration config) { super (config); // add recognized features fConfiguration.addRecognizedFeatures (RECOGNIZED_FEATURES); // set default values fConfiguration.setFeature (CREATE_ENTITY_REF_NODES, true); fConfiguration.setFeature (INCLUDE_IGNORABLE_WHITESPACE, true); fConfiguration.setFeature (DEFER_NODE_EXPANSION, true); fConfiguration.setFeature (INCLUDE_COMMENTS_FEATURE, true); fConfiguration.setFeature (CREATE_CDATA_NODES_FEATURE, true); // add recognized properties fConfiguration.addRecognizedProperties (RECOGNIZED_PROPERTIES); // set default values fConfiguration.setProperty (DOCUMENT_CLASS_NAME, DEFAULT_DOCUMENT_CLASS_NAME); } // <init>(XMLParserConfiguration)