Package ro.isdc.wro.maven.plugin.support
Class ResourceChangeHandler
java.lang.Object
ro.isdc.wro.maven.plugin.support.ResourceChangeHandler
Encapsulates the details about resource change detection and persist the change information in build context.
- Since:
- 1.7.2
- Author:
- Alex Objelean
-
Method Summary
Modifier and TypeMethodDescriptionstatic ResourceChangeHandlercreate(WroManagerFactory managerFactory, org.apache.maven.plugin.logging.Log log) Factory method which requires all mandatory fields.voiddestroy()Destroys all information about resource tracked for changes.voidAfter invoking this method on a resource, the next invocation ofisResourceChanged(Resource)will return true.org.apache.maven.plugin.logging.LoggetLog()booleanbooleanisResourceChanged(Resource resource) voidpersist()Persist the values stored in BuildContext(Holder)voidWill persist the information regarding the provided resource in some internal store.setBuildContext(org.sonatype.plexus.build.incremental.BuildContext buildContext) setBuildDirectory(File buildDirectory) setIncrementalBuildEnabled(boolean incrementalBuildEnabled) setLog(org.apache.maven.plugin.logging.Log log) setManagerFactory(WroManagerFactory wroManagerFactory)
-
Method Details
-
create
public static ResourceChangeHandler create(WroManagerFactory managerFactory, org.apache.maven.plugin.logging.Log log) Factory method which requires all mandatory fields. -
isResourceChanged
-
remember
Will persist the information regarding the provided resource in some internal store. This information will be used later to check if the resource is changed.- Parameters:
resource-Resourceto touch.
-
getLog
public org.apache.maven.plugin.logging.Log getLog() -
setManagerFactory
-
setLog
-
setBuildContext
public ResourceChangeHandler setBuildContext(org.sonatype.plexus.build.incremental.BuildContext buildContext) -
setBuildDirectory
-
setIncrementalBuildEnabled
-
isIncrementalBuild
public boolean isIncrementalBuild() -
destroy
public void destroy()Destroys all information about resource tracked for changes. -
forget
After invoking this method on a resource, the next invocation ofisResourceChanged(Resource)will return true.- Parameters:
resource- The resource to clear from persisted storage.
-
persist
public void persist()Persist the values stored in BuildContext(Holder)
-