Java Code Examples for proguard.util.ListUtil#commaSeparatedList()

The following examples show how to use proguard.util.ListUtil#commaSeparatedList() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FilterDialog.java    From bazel with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the ear filter currently represented in this dialog.
 */
public List getEarFilter()
{
    String filter = earFilterTextField.getText();

    return filter.equals(DEFAULT_EAR_FILTER) ? null : ListUtil.commaSeparatedList(filter);
}
 
Example 2
Source File: FilterDialog.java    From bazel with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the zip filter currently represented in this dialog.
 */
public List getZipFilter()
{
    String filter = zipFilterTextField.getText();

    return filter.equals(DEFAULT_ZIP_FILTER) ? null : ListUtil.commaSeparatedList(filter);
}
 
Example 3
Source File: FilterDialog.java    From proguard with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the apk filter currently represented in this dialog.
 */
public List getApkFilter()
{
    String filter = apkFilterTextField.getText();

    return filter.equals(DEFAULT_APK_FILTER) ? null : ListUtil.commaSeparatedList(filter);
}
 
Example 4
Source File: FilterDialog.java    From proguard with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the jar filter currently represented in this dialog.
 */
public List getJarFilter()
{
    String filter = jarFilterTextField.getText();

    return filter.equals(DEFAULT_JAR_FILTER) ? null : ListUtil.commaSeparatedList(filter);
}
 
Example 5
Source File: FilterDialog.java    From proguard with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the aar filter currently represented in this dialog.
 */
public List getAarFilter()
{
    String filter = aarFilterTextField.getText();

    return filter.equals(DEFAULT_AAR_FILTER) ? null : ListUtil.commaSeparatedList(filter);
}
 
Example 6
Source File: FilterDialog.java    From proguard with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the war filter currently represented in this dialog.
 */
public List getWarFilter()
{
    String filter = warFilterTextField.getText();

    return filter.equals(DEFAULT_WAR_FILTER) ? null : ListUtil.commaSeparatedList(filter);
}
 
Example 7
Source File: FilterDialog.java    From proguard with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the ear filter currently represented in this dialog.
 */
public List getEarFilter()
{
    String filter = earFilterTextField.getText();

    return filter.equals(DEFAULT_EAR_FILTER) ? null : ListUtil.commaSeparatedList(filter);
}
 
Example 8
Source File: FilterDialog.java    From proguard with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the jmod filter currently represented in this dialog.
 */
public List getJmodFilter()
{
    String filter = jmodFilterTextField.getText();

    return filter.equals(DEFAULT_JMOD_FILTER) ? null : ListUtil.commaSeparatedList(filter);
}
 
Example 9
Source File: FilterDialog.java    From proguard with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the zip filter currently represented in this dialog.
 */
public List getZipFilter()
{
    String filter = zipFilterTextField.getText();

    return filter.equals(DEFAULT_ZIP_FILTER) ? null : ListUtil.commaSeparatedList(filter);
}
 
Example 10
Source File: FilterDialog.java    From bazel with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the war filter currently represented in this dialog.
 */
public List getWarFilter()
{
    String filter = warFilterTextField.getText();

    return filter.equals(DEFAULT_WAR_FILTER) ? null : ListUtil.commaSeparatedList(filter);
}
 
Example 11
Source File: FilterDialog.java    From bazel with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the aar filter currently represented in this dialog.
 */
public List getAarFilter()
{
    String filter = aarFilterTextField.getText();

    return filter.equals(DEFAULT_AAR_FILTER) ? null : ListUtil.commaSeparatedList(filter);
}
 
Example 12
Source File: FilterDialog.java    From bazel with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the jar filter currently represented in this dialog.
 */
public List getJarFilter()
{
    String filter = jarFilterTextField.getText();

    return filter.equals(DEFAULT_JAR_FILTER) ? null : ListUtil.commaSeparatedList(filter);
}
 
Example 13
Source File: FilterDialog.java    From bazel with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the apk filter currently represented in this dialog.
 */
public List getApkFilter()
{
    String filter = apkFilterTextField.getText();

    return filter.equals(DEFAULT_APK_FILTER) ? null : ListUtil.commaSeparatedList(filter);
}
 
Example 14
Source File: FilterDialog.java    From bazel with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the filter currently represented in this dialog.
 */
public List getFilter()
{
    String filter = filterTextField.getText();

    return filter.equals(DEFAULT_FILTER) ? null : ListUtil.commaSeparatedList(filter);
}
 
Example 15
Source File: ProGuardTask.java    From proguard with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Creates a specification of class members, based on the given parameters.
 */
private MemberSpecification createMemberSpecification(boolean isMethod,
                                                      boolean isConstructor,
                                                      Map     classSpecificationArgs)
throws ParseException
{
    // Extract the arguments.
    String access            = (String)classSpecificationArgs.get("access");
    String type              = (String)classSpecificationArgs.get("type");
    String annotation        = (String)classSpecificationArgs.get("annotation");
    String name              = (String)classSpecificationArgs.get("name");
    String parameters        = (String)classSpecificationArgs.get("parameters");

    // Perform some basic conversions and checks on the attributes.
    if (annotation != null)
    {
        annotation = ClassUtil.internalType(annotation);
    }

    if (isMethod)
    {
        if (isConstructor)
        {
            if (type != null)
            {
                throw new ParseException("Type attribute not allowed in constructor specification ["+type+"]");
            }

            if (parameters != null)
            {
                type = JavaConstants.TYPE_VOID;
            }

            name = ClassConstants.METHOD_NAME_INIT;
        }
        else if ((type != null) ^ (parameters != null))
        {
            throw new ParseException("Type and parameters attributes must always be present in combination in method specification");
        }
    }
    else
    {
        if (parameters != null)
        {
            throw new ParseException("Parameters attribute not allowed in field specification ["+parameters+"]");
        }
    }

    List parameterList = ListUtil.commaSeparatedList(parameters);

    String descriptor =
        parameters != null ? ClassUtil.internalMethodDescriptor(type, parameterList) :
        type       != null ? ClassUtil.internalType(type)                            :
                             null;

    return new MemberSpecification(requiredMemberAccessFlags(true,  access),
                                   requiredMemberAccessFlags(false, access),
                                   annotation,
                                   name,
                                   descriptor);
}
 
Example 16
Source File: MemberSpecificationElement.java    From bazel with Apache License 2.0 4 votes vote down vote up
/**
 * Adds the contents of this class member specification element to the given
 * list.
 * @param memberSpecifications the class member specifications to be
 *                                  extended.
 * @param isMethod                  specifies whether this specification
 *                                  refers to a method.
 * @param isConstructor             specifies whether this specification
 *                                  refers to a constructor.
 */
public void appendTo(List    memberSpecifications,
                     boolean isMethod,
                     boolean isConstructor)
{
    // Get the referenced file set, or else this one.
    MemberSpecificationElement memberSpecificationElement = isReference() ?
        (MemberSpecificationElement)getCheckedRef(this.getClass(),
                                                  this.getClass().getName()) :
        this;

    // Create a new class member specification.
    String access     = memberSpecificationElement.access;
    String type       = memberSpecificationElement.type;
    String annotation = memberSpecificationElement.annotation;
    String name       = memberSpecificationElement.name;
    String parameters = memberSpecificationElement.parameters;

    // Perform some basic conversions and checks on the attributes.
    if (annotation != null)
    {
        annotation = ClassUtil.internalType(annotation);
    }

    if (isMethod)
    {
        if (isConstructor)
        {
            if (type != null)
            {
                throw new BuildException("Type attribute not allowed in constructor specification ["+type+"]");
            }

            if (parameters != null)
            {
                type = JavaConstants.TYPE_VOID;
            }

            name = ClassConstants.METHOD_NAME_INIT;
        }
        else if ((type != null) ^ (parameters != null))
        {
            throw new BuildException("Type and parameters attributes must always be present in combination in method specification");
        }
    }
    else
    {
        if (parameters != null)
        {
            throw new BuildException("Parameters attribute not allowed in field specification ["+parameters+"]");
        }
    }

    List parameterList = ListUtil.commaSeparatedList(parameters);

    String descriptor =
        parameters != null ? ClassUtil.internalMethodDescriptor(type, parameterList) :
        type       != null ? ClassUtil.internalType(type)                            :
                             null;

    MemberSpecification memberSpecification =
        new MemberSpecification(requiredAccessFlags(true,  access),
                                requiredAccessFlags(false, access),
                                annotation,
                                name,
                                descriptor);

    // Add it to the list.
    memberSpecifications.add(memberSpecification);
}
 
Example 17
Source File: ProGuardTask.java    From bazel with Apache License 2.0 4 votes vote down vote up
/**
 * Creates a specification of class members, based on the given parameters.
 */
private MemberSpecification createMemberSpecification(boolean isMethod,
                                                      boolean isConstructor,
                                                      Map     classSpecificationArgs)
throws ParseException
{
    // Extract the arguments.
    String access            = (String)classSpecificationArgs.get("access");
    String type              = (String)classSpecificationArgs.get("type");
    String annotation        = (String)classSpecificationArgs.get("annotation");
    String name              = (String)classSpecificationArgs.get("name");
    String parameters        = (String)classSpecificationArgs.get("parameters");

    // Perform some basic conversions and checks on the attributes.
    if (annotation != null)
    {
        annotation = ClassUtil.internalType(annotation);
    }

    if (isMethod)
    {
        if (isConstructor)
        {
            if (type != null)
            {
                throw new ParseException("Type attribute not allowed in constructor specification ["+type+"]");
            }

            if (parameters != null)
            {
                type = JavaConstants.TYPE_VOID;
            }

            name = ClassConstants.METHOD_NAME_INIT;
        }
        else if ((type != null) ^ (parameters != null))
        {
            throw new ParseException("Type and parameters attributes must always be present in combination in method specification");
        }
    }
    else
    {
        if (parameters != null)
        {
            throw new ParseException("Parameters attribute not allowed in field specification ["+parameters+"]");
        }
    }

    List parameterList = ListUtil.commaSeparatedList(parameters);

    String descriptor =
        parameters != null ? ClassUtil.internalMethodDescriptor(type, parameterList) :
        type       != null ? ClassUtil.internalType(type)                            :
                             null;

    return new MemberSpecification(requiredMemberAccessFlags(true,  access),
                                   requiredMemberAccessFlags(false, access),
                                   annotation,
                                   name,
                                   descriptor);
}
 
Example 18
Source File: MemberSpecificationElement.java    From proguard with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Adds the contents of this class member specification element to the given
 * list.
 * @param memberSpecifications the class member specifications to be
 *                                  extended.
 * @param isMethod                  specifies whether this specification
 *                                  refers to a method.
 * @param isConstructor             specifies whether this specification
 *                                  refers to a constructor.
 */
public void appendTo(List    memberSpecifications,
                     boolean isMethod,
                     boolean isConstructor)
{
    // Get the referenced file set, or else this one.
    MemberSpecificationElement memberSpecificationElement = isReference() ?
        (MemberSpecificationElement)getCheckedRef(this.getClass(),
                                                  this.getClass().getName()) :
        this;

    // Create a new class member specification.
    String access     = memberSpecificationElement.access;
    String type       = memberSpecificationElement.type;
    String annotation = memberSpecificationElement.annotation;
    String name       = memberSpecificationElement.name;
    String parameters = memberSpecificationElement.parameters;

    // Perform some basic conversions and checks on the attributes.
    if (annotation != null)
    {
        annotation = ClassUtil.internalType(annotation);
    }

    if (isMethod)
    {
        if (isConstructor)
        {
            if (type != null)
            {
                throw new BuildException("Type attribute not allowed in constructor specification ["+type+"]");
            }

            if (parameters != null)
            {
                type = JavaConstants.TYPE_VOID;
            }

            name = ClassConstants.METHOD_NAME_INIT;
        }
        else if ((type != null) ^ (parameters != null))
        {
            throw new BuildException("Type and parameters attributes must always be present in combination in method specification");
        }
    }
    else
    {
        if (parameters != null)
        {
            throw new BuildException("Parameters attribute not allowed in field specification ["+parameters+"]");
        }
    }

    List parameterList = ListUtil.commaSeparatedList(parameters);

    String descriptor =
        parameters != null ? ClassUtil.internalMethodDescriptor(type, parameterList) :
        type       != null ? ClassUtil.internalType(type)                            :
                             null;

    MemberSpecification memberSpecification =
        new MemberSpecification(requiredAccessFlags(true,  access),
                                requiredAccessFlags(false, access),
                                annotation,
                                name,
                                descriptor);

    // Add it to the list.
    memberSpecifications.add(memberSpecification);
}
 
Example 19
Source File: MemberSpecificationElement.java    From proguard with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Adds the contents of this class member specification element to the given
 * list.
 * @param memberSpecifications the class member specifications to be
 *                                  extended.
 * @param isMethod                  specifies whether this specification
 *                                  refers to a method.
 * @param isConstructor             specifies whether this specification
 *                                  refers to a constructor.
 */
public void appendTo(List    memberSpecifications,
                     boolean isMethod,
                     boolean isConstructor)
{
    // Get the referenced file set, or else this one.
    MemberSpecificationElement memberSpecificationElement = isReference() ?
        (MemberSpecificationElement)getCheckedRef(this.getClass(),
                                                  this.getClass().getName()) :
        this;

    // Create a new class member specification.
    String access     = memberSpecificationElement.access;
    String type       = memberSpecificationElement.type;
    String annotation = memberSpecificationElement.annotation;
    String name       = memberSpecificationElement.name;
    String parameters = memberSpecificationElement.parameters;
    String values     = memberSpecificationElement.values;

    // Perform some basic conversions and checks on the attributes.
    if (annotation != null)
    {
        annotation = ClassUtil.internalType(annotation);
    }

    if (isMethod)
    {
        if (isConstructor)
        {
            if (type != null)
            {
                throw new BuildException("Type attribute not allowed in constructor specification ["+type+"]");
            }

            if (parameters != null)
            {
                type = JavaTypeConstants.VOID;
            }

            if (values != null)
            {
                throw new BuildException("Values attribute not allowed in constructor specification ["+values+"]");
            }

            name = ClassConstants.METHOD_NAME_INIT;
        }
        else if ((type != null) ^ (parameters != null))
        {
            throw new BuildException("Type and parameters attributes must always be present in combination in method specification");
        }
    }
    else
    {
        if (parameters != null)
        {
            throw new BuildException("Parameters attribute not allowed in field specification ["+parameters+"]");
        }
    }

    if (values != null)
    {
        if (type == null)
        {
            throw new BuildException("Values attribute must be specified in combination with type attribute in class member specification ["+values+"]");
        }
    }

    List parameterList = ListUtil.commaSeparatedList(parameters);

    String descriptor =
        parameters != null ? ClassUtil.internalMethodDescriptor(type, parameterList) :
        type       != null ? ClassUtil.internalType(type)                            :
                             null;

    MemberSpecification memberSpecification = values != null ?
        new MemberValueSpecification(requiredAccessFlags(true, access),
                                     requiredAccessFlags(false, access),
                                     annotation,
                                     name,
                                     descriptor,
                                     parseValues(type,
                                                 ClassUtil.internalType(type),
                                                 values)) :
        new MemberSpecification(requiredAccessFlags(true,  access),
                                requiredAccessFlags(false, access),
                                annotation,
                                name,
                                descriptor);

    // Add it to the list.
    memberSpecifications.add(memberSpecification);
}
 
Example 20
Source File: ProGuardTask.java    From proguard with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Creates a specification of class members, based on the given parameters.
 */
private MemberSpecification createMemberSpecification(boolean isMethod,
                                                      boolean isConstructor,
                                                      boolean allowValues,
                                                      Map     classSpecificationArgs)
throws ParseException
{
    // Extract the arguments.
    String access            = (String)classSpecificationArgs.get("access");
    String type              = (String)classSpecificationArgs.get("type");
    String annotation        = (String)classSpecificationArgs.get("annotation");
    String name              = (String)classSpecificationArgs.get("name");
    String parameters        = (String)classSpecificationArgs.get("parameters");
    String values            = (String)classSpecificationArgs.get("value");

    // Perform some basic conversions and checks on the attributes.
    if (annotation != null)
    {
        annotation = ClassUtil.internalType(annotation);
    }

    if (isMethod)
    {
        if (isConstructor)
        {
            if (type != null)
            {
                throw new ParseException("Type attribute not allowed in constructor specification ["+type+"]");
            }

            if (parameters != null)
            {
                type = JavaTypeConstants.VOID;
            }

            if (values != null)
            {
                throw new ParseException("Values attribute not allowed in constructor specification ["+values+"]");
            }

            name = ClassConstants.METHOD_NAME_INIT;
        }
        else if ((type != null) ^ (parameters != null))
        {
            throw new ParseException("Type and parameters attributes must always be present in combination in method specification");
        }
    }
    else
    {
        if (parameters != null)
        {
            throw new ParseException("Parameters attribute not allowed in field specification ["+parameters+"]");
        }
    }

    if (values != null)
    {
        if (!allowValues)
        {
            throw new ParseException("Values attribute not allowed in this class specification ["+values+"]");
        }

        if (type == null)
        {
            throw new ParseException("Values attribute must be specified in combination with type attribute in class member specification ["+values+"]");
        }
    }

    List parameterList = ListUtil.commaSeparatedList(parameters);

    String descriptor =
        parameters != null ? ClassUtil.internalMethodDescriptor(type, parameterList) :
        type       != null ? ClassUtil.internalType(type)                            :
                             null;

    return values != null ?
        new MemberValueSpecification(requiredMemberAccessFlags(true,  access),
                                     requiredMemberAccessFlags(false, access),
                                     annotation,
                                     name,
                                     descriptor,
                                     parseValues(type,
                                                 ClassUtil.internalType(type),
                                                 values)) :
        new MemberSpecification(requiredMemberAccessFlags(true,  access),
                                requiredMemberAccessFlags(false, access),
                                annotation,
                                name,
                                descriptor);
}