コード例 #1
0
  /**
   * @param componentManager The component manager.
   * @throws SAXException Throws exception if required features and properties cannot be found.
   */
  public void reset(XMLComponentManager componentManager) throws XMLConfigurationException {

    fParserSettings = componentManager.getFeature(PARSER_SETTINGS, true);

    if (!fParserSettings) {
      // parser settings have not been changed
      init();
      return;
    }

    // Xerces properties
    fSymbolTable = (SymbolTable) componentManager.getProperty(SYMBOL_TABLE);
    fErrorReporter = (XMLErrorReporter) componentManager.getProperty(ERROR_REPORTER);
    fEntityManager = (XMLEntityManager) componentManager.getProperty(ENTITY_MANAGER);
    fSecurityManager = (XMLSecurityManager) componentManager.getProperty(SECURITY_MANAGER);

    // this step is extra because we have separated the storage of entity
    fEntityStore = fEntityManager.getEntityStore();

    // sax features
    fValidation = componentManager.getFeature(VALIDATION, false);
    fNamespaces = componentManager.getFeature(NAMESPACES, true);
    fNotifyCharRefs = componentManager.getFeature(NOTIFY_CHAR_REFS, false);

    init();
  } // reset(XMLComponentManager)
コード例 #2
0
  /**
   * This method notifies of the start of an entity. The document entity has the pseudo-name of
   * "[xml]" the DTD has the pseudo-name of "[dtd]" parameter entity names start with '%'; and
   * general entities are just specified by their name.
   *
   * @param name The name of the entity.
   * @param identifier The resource identifier.
   * @param encoding The auto-detected IANA encoding name of the entity stream. This value will be
   *     null in those situations where the entity encoding is not auto-detected (e.g. internal
   *     entities or a document entity that is parsed from a java.io.Reader).
   * @throws XNIException Thrown by handler to signal an error.
   */
  public void startEntity(
      String name, XMLResourceIdentifier identifier, String encoding, Augmentations augs)
      throws XNIException {

    // keep track of the entity depth
    fEntityDepth++;
    // must reset entity scanner
    fEntityScanner = fEntityManager.getEntityScanner();
    fEntityStore = fEntityManager.getEntityStore();
  } // startEntity(String,XMLResourceIdentifier,String)
コード例 #3
0
ファイル: XMLScanner.java プロジェクト: JSitesh/ikvm-openjdk
  public void reset(PropertyManager propertyManager) {
    init();
    // Xerces properties
    fSymbolTable =
        (SymbolTable)
            propertyManager.getProperty(
                Constants.XERCES_PROPERTY_PREFIX + Constants.SYMBOL_TABLE_PROPERTY);

    fErrorReporter =
        (XMLErrorReporter)
            propertyManager.getProperty(
                Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY);

    fEntityManager = (XMLEntityManager) propertyManager.getProperty(ENTITY_MANAGER);
    fEntityStore = fEntityManager.getEntityStore();
    fEntityScanner = (XMLEntityScanner) fEntityManager.getEntityScanner();
    // fEntityManager.reset();
    // DTD preparsing defaults:
    fValidation = false;
    fNotifyCharRefs = false;
  }