Class DocumentTypeAdvancedCustomRuleMatcher

java.lang.Object
ro.sync.ecss.extensions.api.DocumentTypeAdvancedCustomRuleMatcher
All Implemented Interfaces:
DocumentTypeCustomRuleMatcher, Extension
Direct Known Subclasses:
DITAMapResolvedReferencesCustomRuleMatcher, HTML5CustomRuleMatcher, JSONAndYAMLPropertiesRuleMatcherBase, JSONAndYAMLRuleMatcherBase

@API(type=EXTENDABLE, src=PUBLIC) public abstract class DocumentTypeAdvancedCustomRuleMatcher extends Object implements DocumentTypeCustomRuleMatcher
Abstract class which can be implemented to provide custom matching to the document type it belongs to.
Since:
17.1
  • Constructor Details

    • DocumentTypeAdvancedCustomRuleMatcher

      public DocumentTypeAdvancedCustomRuleMatcher()
  • Method Details

    • matches

      public boolean matches(String systemID, String rootNamespace, String rootLocalName, String doctypePublicID, Attributes rootAttributes)
      Description copied from interface: DocumentTypeCustomRuleMatcher
      Check if the document type to which this custom rule belongs to should be used for the given document properties.
      Specified by:
      matches in interface DocumentTypeCustomRuleMatcher
      Parameters:
      systemID - The system ID of the current file in an URL format with not allowed characters corrected. For example: "file:/C:/path/to/file/file.xml"
      rootNamespace - The namespace of the root.
      rootLocalName - The root local name.
      doctypePublicID - The public id of the specified DTD if any.
      rootAttributes - The root attributes. The attributes are DOM level 2 and the namespaces are available for each one.
      Returns:
      true if the document type to which this rule belongs to will be used for the current file.
      See Also:
    • matches

      public boolean matches(String systemID, String rootNamespace, String rootLocalName, String doctypePublicID, Attributes rootAttributes, Reader contentReader)
      Check if the document type to which this custom rule belongs to should be used for the given document properties. This method receives a reader over the entire content.
      Parameters:
      systemID - The system ID of the current file in an URL format with not allowed characters corrected. For example: "file:/C:/path/to/file/file.xml"
      rootNamespace - The namespace of the root.
      rootLocalName - The root local name.
      doctypePublicID - The public id of the specified DTD if any.
      rootAttributes - The root attributes. The attributes are DOM level 2 and the namespaces are available for each one.
      contentReader - Reader over the entire XML content. Can be used for detection if all other parameters are not enough. The reader does not need to be reset or closed. It may be null.
      Returns:
      true if the document type to which this rule belongs to will be used for the current file.
    • matches

      public boolean matches(String systemID, String rootNamespace, String rootLocalName, String doctypePublicID, String doctypeSystemID, Attributes rootAttributes, Map<String,String> queryParameters, Reader contentReader)
      Check if the document type to which this custom rule belongs to should be used for the given document properties. This method receives a reader over the entire content.
      Parameters:
      systemID - The system ID of the current file in an URL format with not allowed characters corrected. For example: "file:/C:/path/to/file/file.xml"
      rootNamespace - The namespace of the root.
      rootLocalName - The root local name.
      doctypePublicID - The public id of the specified DTD if any.
      doctypeSystemID - The system id of the specified DTD if any.
      rootAttributes - The root attributes. The attributes are DOM level 2 and the namespaces are available for each one.
      queryParameters - The parameters which were set in the query string used to open this resource. May be null.
      contentReader - Reader over the entire XML content. Can be used for detection if all other parameters are not enough. The reader does not need to be reset or closed. It may be null.
      Returns:
      true if the document type to which this rule belongs to will be used for the current file.
      Since:
      23