程序包 proguard

类 ConfigurationParser

  • 所有已实现的接口:
    java.lang.AutoCloseable

    public class ConfigurationParser
    extends java.lang.Object
    implements java.lang.AutoCloseable
    This class parses ProGuard configurations. Configurations can be read from an array of arguments or from a configuration file or URL. External references in file names ('<...>') can be resolved against a given set of properties.
    • 构造器概要

      构造器 
      构造器 说明
      ConfigurationParser​(java.io.File file)
      已过时。
      Temporary code for backward compatibility in Obclipse.
      ConfigurationParser​(java.io.File file, java.util.Properties properties)
      Creates a new ConfigurationParser for the given file and the given Properties.
      ConfigurationParser​(java.lang.String[] args, java.io.File baseDir, java.util.Properties properties)
      Creates a new ConfigurationParser for the given String arguments, with the given base directory and the given Properties.
      ConfigurationParser​(java.lang.String[] args, java.util.Properties properties)
      Creates a new ConfigurationParser for the given String arguments and the given Properties.
      ConfigurationParser​(java.lang.String lines, java.lang.String description, java.io.File baseDir, java.util.Properties properties)
      Creates a new ConfigurationParser for the given lines, with the given base directory and the given Properties.
      ConfigurationParser​(java.net.URL url, java.util.Properties properties)
      Creates a new ConfigurationParser for the given URL and the given Properties.
      ConfigurationParser​(WordReader reader, java.util.Properties properties)
      Creates a new ConfigurationParser for the given word reader and the given Properties.
    • 构造器详细资料

      • ConfigurationParser

        public ConfigurationParser​(java.lang.String[] args,
                                   java.util.Properties properties)
                            throws java.io.IOException
        Creates a new ConfigurationParser for the given String arguments and the given Properties.
        抛出:
        java.io.IOException
      • ConfigurationParser

        public ConfigurationParser​(java.lang.String[] args,
                                   java.io.File baseDir,
                                   java.util.Properties properties)
                            throws java.io.IOException
        Creates a new ConfigurationParser for the given String arguments, with the given base directory and the given Properties.
        抛出:
        java.io.IOException
      • ConfigurationParser

        public ConfigurationParser​(java.lang.String lines,
                                   java.lang.String description,
                                   java.io.File baseDir,
                                   java.util.Properties properties)
                            throws java.io.IOException
        Creates a new ConfigurationParser for the given lines, with the given base directory and the given Properties.
        抛出:
        java.io.IOException
      • ConfigurationParser

        public ConfigurationParser​(java.io.File file)
                            throws java.io.IOException
        已过时。
        Temporary code for backward compatibility in Obclipse.
        Creates a new ConfigurationParser for the given file, with the system Properties.
        抛出:
        java.io.IOException
      • ConfigurationParser

        public ConfigurationParser​(java.io.File file,
                                   java.util.Properties properties)
                            throws java.io.IOException
        Creates a new ConfigurationParser for the given file and the given Properties.
        抛出:
        java.io.IOException
      • ConfigurationParser

        public ConfigurationParser​(java.net.URL url,
                                   java.util.Properties properties)
                            throws java.io.IOException
        Creates a new ConfigurationParser for the given URL and the given Properties.
        抛出:
        java.io.IOException
      • ConfigurationParser

        public ConfigurationParser​(WordReader reader,
                                   java.util.Properties properties)
                            throws java.io.IOException
        Creates a new ConfigurationParser for the given word reader and the given Properties.
        抛出:
        java.io.IOException
    • 方法详细资料

      • parse

        public void parse​(Configuration configuration)
                   throws ParseException,
                          java.io.IOException
        Parses and returns the configuration.
        参数:
        configuration - the configuration that is updated as a side-effect.
        抛出:
        ParseException - if the any of the configuration settings contains a syntax error.
        java.io.IOException - if an IO error occurs while reading a configuration.
      • parse

        public void parse​(Configuration configuration,
                          java.util.function.BiConsumer<java.lang.String,​java.lang.String> unknownOptionHandler)
                   throws ParseException,
                          java.io.IOException
        Parses and returns the configuration.
        参数:
        configuration - the configuration that is updated as a side-effect.
        unknownOptionHandler - optional handler for unknown options; if null then a ParseException is thrown when encountering an unknown option.
        抛出:
        ParseException - if the any of the configuration settings contains a syntax error.
        java.io.IOException - if an IO error occurs while reading a configuration.
      • close

        public void close()
                   throws java.io.IOException
        Closes the configuration.
        指定者:
        close 在接口中 java.lang.AutoCloseable
        抛出:
        java.io.IOException - if an IO error occurs while closing the configuration.
      • parseClassSpecificationArguments

        public ClassSpecification parseClassSpecificationArguments​(boolean readFirstWord,
                                                                   boolean allowClassMembers,
                                                                   boolean allowValues)
                                                            throws ParseException,
                                                                   java.io.IOException
        Parses and returns a class specification. For example: "public class SomeClass { public void someMethod(); }"
        抛出:
        ParseException - if the class specification contains a syntax error.
        java.io.IOException - if an IO error occurs while reading the class specification.
      • main

        public static void main​(java.lang.String[] args)
        A main method for testing configuration parsing.