Class DefaultFilter

    • Constructor Detail

      • DefaultFilter

        public DefaultFilter()
    • Method Detail

      • startDocument

        public void startDocument​(XMLLocator locator,
                                  java.lang.String encoding,
                                  NamespaceContext nscontext,
                                  Augmentations augs)
                           throws XNIException
        Start document.
        Specified by:
        startDocument in interface XMLDocumentHandler
        Parameters:
        locator - The document locator, or null if the document location cannot be reported during the parsing of this document. However, it is strongly recommended that a locator be supplied that can at least report the system identifier of the document.
        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).
        nscontext - The namespace context in effect at the start of this document. This object represents the current context. Implementors of this class are responsible for copying the namespace bindings from the the current context (and its parent contexts) if that information is important.
        augs - Additional information that may include infoset augmentations
        Throws:
        XNIException - Thrown by handler to signal an error.
      • xmlDecl

        public void xmlDecl​(java.lang.String version,
                            java.lang.String encoding,
                            java.lang.String standalone,
                            Augmentations augs)
                     throws XNIException
        XML declaration.
        Specified by:
        xmlDecl in interface XMLDocumentHandler
        Parameters:
        version - The XML version.
        encoding - The IANA encoding name of the document, or null if not specified.
        standalone - The standalone value, or null if not specified.
        augs - Additional information that may include infoset augmentations
        Throws:
        XNIException - Thrown by handler to signal an error.
      • doctypeDecl

        public void doctypeDecl​(java.lang.String root,
                                java.lang.String publicId,
                                java.lang.String systemId,
                                Augmentations augs)
                         throws XNIException
        Doctype declaration.
        Specified by:
        doctypeDecl in interface XMLDocumentHandler
        Parameters:
        root - The name of the root element.
        publicId - The public identifier if an external DTD or null if the external DTD is specified using SYSTEM.
        systemId - The system identifier if an external DTD, null otherwise.
        augs - Additional information that may include infoset augmentations
        Throws:
        XNIException - Thrown by handler to signal an error.
      • processingInstruction

        public void processingInstruction​(java.lang.String target,
                                          XMLString data,
                                          Augmentations augs)
                                   throws XNIException
        Processing instruction.
        Specified by:
        processingInstruction in interface XMLDocumentHandler
        Parameters:
        target - The target.
        data - The data or null if none specified.
        augs - Additional information that may include infoset augmentations
        Throws:
        XNIException - Thrown by handler to signal an error.
      • getRecognizedFeatures

        public java.lang.String[] getRecognizedFeatures()
        Returns a list of feature identifiers that are recognized by this component. This method may return null if no features are recognized by this component.
        Specified by:
        getRecognizedFeatures in interface XMLComponent
        Returns:
        an array of feature identifiers that are recognized by this component. This method may return null if no features are recognized by this component.
      • getFeatureDefault

        public java.lang.Boolean getFeatureDefault​(java.lang.String featureId)
        Returns the default state for a feature, or null if this component does not want to report a default value for this feature.
        Specified by:
        getFeatureDefault in interface HTMLComponent
        Specified by:
        getFeatureDefault in interface XMLComponent
        Parameters:
        featureId - The feature identifier.
        Returns:
        the default state for a feature, or null if this component does not want to report a default value for this feature.
      • getRecognizedProperties

        public java.lang.String[] getRecognizedProperties()
        Returns a list of property identifiers that are recognized by this component. This method may return null if no properties are recognized by this component.
        Specified by:
        getRecognizedProperties in interface XMLComponent
        Returns:
        an array of property identifiers that are recognized by this component. This method may return null if no properties are recognized by this component.
      • getPropertyDefault

        public java.lang.Object getPropertyDefault​(java.lang.String propertyId)
        Returns the default state for a property, or null if this component does not want to report a default value for this property.
        Specified by:
        getPropertyDefault in interface HTMLComponent
        Specified by:
        getPropertyDefault in interface XMLComponent
        Parameters:
        propertyId - The property identifier.
        Returns:
        the default state for a property, or null if this component does not want to report a default value for this property
      • setFeature

        public void setFeature​(java.lang.String featureId,
                               boolean state)
                        throws XMLConfigurationException
        Sets the state of a feature. This method is called by the component manager any time after reset when a feature changes state.

        Note: Components should silently ignore features that do not affect the operation of the component.

        Specified by:
        setFeature in interface XMLComponent
        Parameters:
        featureId - The feature identifier.
        state - The state of the feature.
        Throws:
        XMLConfigurationException - Thrown for configuration error. In general, components should only throw this exception if it is really a critical error.
      • setProperty

        public void setProperty​(java.lang.String propertyId,
                                java.lang.Object value)
                         throws XMLConfigurationException
        Sets the value of a property. This method is called by the component manager any time after reset when a property changes value.

        Note: Components should silently ignore properties that do not affect the operation of the component.

        Specified by:
        setProperty in interface XMLComponent
        Parameters:
        propertyId - The property identifier.
        value - The value of the property.
        Throws:
        XMLConfigurationException - Thrown for configuration error. In general, components should only throw this exception if it is really a critical error.
      • merge

        protected static java.lang.String[] merge​(java.lang.String[] array1,
                                                  java.lang.String[] array2)
        Utility method for merging string arrays for recognized features and recognized properties.
        Parameters:
        array1 - array1
        array2 - array2
        Returns:
        the merged array