Class 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.ZipFileSet
    Used by ant to handle the adjust element.
    • Field Summary

      • Fields inherited from class org.apache.tools.ant.types.ArchiveFileSet

        DEFAULT_DIR_MODE, DEFAULT_FILE_MODE
      • Fields inherited from class org.apache.tools.ant.types.DataType

        checked, ref
      • Fields inherited from class org.apache.tools.ant.ProjectComponent

        description, location, project
    • Constructor Summary

      Constructors 
      Constructor Description
      AdjustSection()
      Instantiates a new Adjust section.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean contains​(java.lang.String name)
      Determines if the jar entry with the given name has to be adjusted.
      void createEntries​(java.util.Collection srcJars)
      Initialize the set of jar entries that are matched by this adjust section.
      boolean getReplaceContent()
      Determines if the contents of matched jar entries have to be adjusted.
      ObfuscatorTask.ReplaceContentPolicy getReplaceContentPolicy()
      Returns the policy for adjusting the content of matched jar entries.
      java.lang.String getReplaceContentSeparator()
      Returns the separator character for finding content class or package identifiers of matched jar entries that have to be adjusted.
      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.
      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.
      ObfuscatorTask.ReplacePathPolicy getReplacePathPolicy()
      Returns the policy for adjusting the path to and name of matched jar entries.
      void setReplaceContent​(boolean enabled)
      Specifies if the contents of matched jar entries have to be adjusted.
      void setReplaceContentPolicy​(ObfuscatorTask.ReplaceContentPolicy policy)
      Specifies the policy for adjusting the content of matched jar entries.
      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.
      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.
      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.
      void setReplacePathPolicy​(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
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
      • Methods inherited from interface org.apache.tools.ant.types.ResourceCollection

        isEmpty, stream
    • Constructor Detail

      • AdjustSection

        public AdjustSection()
        Instantiates a new Adjust section.
    • 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:
        true if the jar entry with the given name will be adjusted; false otherwise.
      • setReplaceContent

        public void setReplaceContent​(boolean enabled)
        Specifies if the contents of matched jar entries have to be adjusted.
        Parameters:
        enabled - if true, 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:
        true if the contents of matched jar entries will be adjusted; false otherwise.
      • 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 of setReplaceName(boolean).
        Parameters:
        enabled - if false, 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 of getReplaceName().
        Returns:
        false if the path of jar entries that are renamed will not be changed; true otherwise.
        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:
        true if 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() to false.

        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) to false.

        Parameters:
        enabled - if true, 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.IOException
        Initialize 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