Class AbstractStaticChecker
- java.lang.Object
-
- com.marklogic.client.ext.helper.LoggingObject
-
- com.marklogic.client.ext.modulesloader.impl.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.
-
-
Field Summary
-
Fields inherited from class com.marklogic.client.ext.helper.LoggingObject
logger
-
-
Constructor Summary
Constructors Constructor Description AbstractStaticChecker()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringbuildXqueryForStaticallyCheckingModule()Assumes that there's already a variable in XQuery named "uri" in scope.protected booleancanBeStaticallyChecked(DocumentFile asset)voidcheckLoadedAssets(java.util.List<DocumentFile> assets)protected abstract voidexecuteQuery(java.lang.String xquery)protected voidperformBulkStaticCheck(java.util.List<DocumentFile> assets)voidsetBulkCheck(boolean bulkCheck)voidsetCheckLibraryModules(boolean checkLibraryModules)protected voidstaticallyCheckModule(java.lang.String uri)Statically checks the module at the given URI.-
Methods inherited from class com.marklogic.client.ext.helper.LoggingObject
format
-
-
-
-
Method Detail
-
checkLoadedAssets
public void checkLoadedAssets(java.util.List<DocumentFile> assets)
- Specified by:
checkLoadedAssetsin interfaceStaticChecker
-
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)
-
-