Package com.yworks.yguard
Class ObfuscatorTask.AdjustSection
- java.lang.Object
-
- org.apache.tools.ant.ProjectComponent
-
- org.apache.tools.ant.types.DataType
-
- org.apache.tools.ant.types.AbstractFileSet
-
- org.apache.tools.ant.types.FileSet
-
- org.apache.tools.ant.types.ArchiveFileSet
-
- org.apache.tools.ant.types.ZipFileSet
-
- com.yworks.yguard.ObfuscatorTask.AdjustSection
-
- All Implemented Interfaces:
java.lang.Cloneable,java.lang.Iterable<org.apache.tools.ant.types.Resource>,org.apache.tools.ant.types.ResourceCollection,org.apache.tools.ant.types.selectors.SelectorContainer
- Enclosing class:
- ObfuscatorTask
public static class ObfuscatorTask.AdjustSection extends org.apache.tools.ant.types.ZipFileSetUsed by ant to handle theadjustelement.
-
-
Constructor Summary
Constructors Constructor Description AdjustSection()Instantiates a new Adjust section.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(java.lang.String name)Determines if the jar entry with the given name has to be adjusted.voidcreateEntries(java.util.Collection srcJars)Initialize the set of jar entries that are matched by this adjust section.booleangetReplaceContent()Determines if the contents of matched jar entries have to be adjusted.ObfuscatorTask.ReplaceContentPolicygetReplaceContentPolicy()Returns the policy for adjusting the content of matched jar entries.java.lang.StringgetReplaceContentSeparator()Returns the separator character for finding content class or package identifiers of matched jar entries that have to be adjusted.booleangetReplaceName()Determines if the path and name of matched jar entries whose path and name match the qualified name of a renamed class will be adjusted to match the qualified name of the renamed class.booleangetReplacePath()Determines if the path of matched jar entries whose path and name match the qualified name of a renamed class will be adjusted to match the package name of the renamed class.ObfuscatorTask.ReplacePathPolicygetReplacePathPolicy()Returns the policy for adjusting the path to and name of matched jar entries.voidsetReplaceContent(boolean enabled)Specifies if the contents of matched jar entries have to be adjusted.voidsetReplaceContentPolicy(ObfuscatorTask.ReplaceContentPolicy policy)Specifies the policy for adjusting the content of matched jar entries.voidsetReplaceContentSeparator(java.lang.String separator)Specifies the separator character for finding content class or package identifiers of matched jar entries that have to be adjusted.voidsetReplaceName(boolean enabled)Specifies if the path and name of matched jar entries whose path and name match the qualified name of a renamed class will be adjusted to match the qualified name of the renamed class.voidsetReplacePath(boolean enabled)Specifies if the path of matched jar entries whose path and name match the qualified name of a renamed class will be adjusted to match the package name of the renamed class.voidsetReplacePathPolicy(ObfuscatorTask.ReplacePathPolicy policy)Specifies the policy for adjusting the path to and name of matched jar entries.-
Methods inherited from class org.apache.tools.ant.types.ZipFileSet
clone, getRef, getRef, newArchiveScanner
-
Methods inherited from class org.apache.tools.ant.types.ArchiveFileSet
addConfigured, configureFileSet, dieOnCircularReference, getDirectoryScanner, getDirMode, getDirMode, getEncoding, getFileMode, getFileMode, getFullpath, getFullpath, getPrefix, getPrefix, getSrc, getSrc, hasDirModeBeenSet, hasFileModeBeenSet, integerSetDirMode, integerSetFileMode, isFilesystemOnly, iterator, setDir, setDirMode, setEncoding, setErrorOnMissingArchive, setFileMode, setFullpath, setPrefix, setSrc, setSrcResource, size, toString
-
Methods inherited from class org.apache.tools.ant.types.AbstractFileSet
add, addAnd, addContains, addContainsRegexp, addCustom, addDate, addDepend, addDepth, addDifferent, addExecutable, addFilename, addMajority, addModified, addNone, addNot, addOr, addOwnedBy, addPosixGroup, addPosixPermissions, addPresent, addReadable, addSelector, addSize, addSymlink, addType, addWritable, appendExcludes, appendIncludes, appendSelector, createExclude, createExcludesFile, createInclude, createIncludesFile, createPatternSet, getDefaultexcludes, getDir, getDir, getDirectoryScanner, getErrorOnMissingDir, getMaxLevelsOfSymlinks, getSelectors, hasPatterns, hasSelectors, isCaseSensitive, isFollowSymlinks, mergeExcludes, mergeIncludes, mergePatterns, selectorCount, selectorElements, setCaseSensitive, setDefaultexcludes, setErrorOnMissingDir, setExcludes, setExcludesfile, setFile, setFollowSymlinks, setIncludes, setIncludesfile, setMaxLevelsOfSymlinks, setRefid, setupDirectoryScanner, setupDirectoryScanner
-
Methods inherited from class org.apache.tools.ant.types.DataType
checkAttributesAllowed, checkChildrenAllowed, circularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, pushAndInvokeCircularReferenceCheck, setChecked, tooManyAttributes
-
Methods inherited from class org.apache.tools.ant.ProjectComponent
getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
-
-
-
-
Method Detail
-
contains
public boolean contains(java.lang.String name)
Determines if the jar entry with the given name has to be adjusted.- Parameters:
name- the name of the jar entry to check.- Returns:
trueif the jar entry with the given name will be adjusted;falseotherwise.
-
setReplaceContent
public void setReplaceContent(boolean enabled)
Specifies if the contents of matched jar entries have to be adjusted.- Parameters:
enabled- iftrue, the contents of matched jar entries will be adjusted.
-
getReplaceContent
public boolean getReplaceContent()
Determines if the contents of matched jar entries have to be adjusted.- Returns:
trueif the contents of matched jar entries will be adjusted;falseotherwise.
-
setReplaceContentPolicy
public void setReplaceContentPolicy(ObfuscatorTask.ReplaceContentPolicy policy)
Specifies the policy for adjusting the content of matched jar entries.- Parameters:
policy- the policy that determines if and how to adjust the content of matched jar entries.
-
getReplaceContentPolicy
public ObfuscatorTask.ReplaceContentPolicy getReplaceContentPolicy()
Returns the policy for adjusting the content of matched jar entries.- Returns:
- the policy that determines if and how to adjust the content of matched jar entries.
-
setReplaceContentSeparator
public void setReplaceContentSeparator(java.lang.String separator)
Specifies the separator character for finding content class or package identifiers of matched jar entries that have to be adjusted.- Parameters:
separator- either/or..
-
getReplaceContentSeparator
public java.lang.String getReplaceContentSeparator()
Returns the separator character for finding content class or package identifiers of matched jar entries that have to be adjusted.- Returns:
- either
/or..
-
setReplacePath
public void setReplacePath(boolean enabled)
Specifies if the path of matched jar entries whose path and name match the qualified name of a renamed class will be adjusted to match the package name of the renamed class. This property can only be used to prevent adjusting the path of matched jar entries whose name is changed because ofsetReplaceName(boolean).- Parameters:
enabled- iffalse, the path of jar entries that are renamed will not be changed.- See Also:
setReplaceName(boolean)
-
getReplacePath
public boolean getReplacePath()
Determines if the path of matched jar entries whose path and name match the qualified name of a renamed class will be adjusted to match the package name of the renamed class. This property can only be used to prevent adjusting the path of matched jar entries whose name is changed because ofgetReplaceName().- Returns:
falseif the path of jar entries that are renamed will not be changed;trueotherwise.- See Also:
getReplaceName()
-
getReplaceName
public boolean getReplaceName()
Determines if the path and name of matched jar entries whose path and name match the qualified name of a renamed class will be adjusted to match the qualified name of the renamed class.- Returns:
trueif the path and name of matched jar entries will be adjusted.To adjust only the name of matched entries, but not their path, set
getReplacePath()tofalse.- See Also:
getReplacePath()
-
setReplaceName
public void setReplaceName(boolean enabled)
Specifies if the path and name of matched jar entries whose path and name match the qualified name of a renamed class will be adjusted to match the qualified name of the renamed class.To adjust only the name of matched entries, but not their path, set
setReplacePath(boolean)tofalse.- Parameters:
enabled- iftrue, the path and name of matched jar entries will be adjusted.- See Also:
setReplacePath(boolean)
-
setReplacePathPolicy
public void setReplacePathPolicy(ObfuscatorTask.ReplacePathPolicy policy)
Specifies the policy for adjusting the path to and name of matched jar entries.- Parameters:
policy- the policy that determines if and how to adjust the path to and name of matched jar entries.
-
getReplacePathPolicy
public ObfuscatorTask.ReplacePathPolicy getReplacePathPolicy()
Returns the policy for adjusting the path to and name of matched jar entries.- Returns:
- the policy that determines if and how to adjust the path to and name of matched jar entries.
-
createEntries
public void createEntries(java.util.Collection srcJars) throws java.io.IOExceptionInitialize the set of jar entries that are matched by this adjust section.This method has to be called before
contains(String)can be used.- Parameters:
srcJars- the set of jar entries to check for matches.- Throws:
java.io.IOException
-
-