Class AbstractStaticChecker

  • All Implemented Interfaces:
    StaticChecker
    Direct Known Subclasses:
    XccStaticChecker

    public abstract class AbstractStaticChecker
    extends LoggingObject
    implements StaticChecker
    Has all the guts for doing static checking, but delegates the execution of an XQuery script to a subclass.
    • Constructor Detail

      • AbstractStaticChecker

        public AbstractStaticChecker()
    • Method Detail

      • executeQuery

        protected abstract void executeQuery​(java.lang.String xquery)
      • staticallyCheckModule

        protected void staticallyCheckModule​(java.lang.String uri)
        Statically checks the module at the given URI. Includes support for evaluating a library module by trying to extract its namespace and then using xdmp:eval to evaluate a module that imports the library module. If this fails to extract its namespace, an error will be reported just like if the module itself has an error in it.
        Parameters:
        uri -
      • canBeStaticallyChecked

        protected boolean canBeStaticallyChecked​(DocumentFile asset)
      • performBulkStaticCheck

        protected void performBulkStaticCheck​(java.util.List<DocumentFile> assets)
      • buildXqueryForStaticallyCheckingModule

        protected java.lang.String buildXqueryForStaticallyCheckingModule()
        Assumes that there's already a variable in XQuery named "uri" in scope. If the module is a library module, an attempt is made to extract its namespace and import it in a statement passed to xdmp:eval. If an error occurs in construct that statement, it cannot be distinguished from an error in the actual module. To turn this behavior off, set "staticCheckLibraryModules" to false.
        Returns:
        XQuery script
      • setCheckLibraryModules

        public void setCheckLibraryModules​(boolean checkLibraryModules)
      • setBulkCheck

        public void setBulkCheck​(boolean bulkCheck)