Java Code Examples for com.android.xml.AndroidManifest#combinePackageAndClassName()

The following examples show how to use com.android.xml.AndroidManifest#combinePackageAndClassName() . 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: AndroidManifestParser.java    From java-n-IDE-for-Android with Apache License 2.0 6 votes vote down vote up
/**
 * Processes the service/receiver/provider nodes.
 * @param attributes the attributes for the activity node.
 * @param superClassName the fully qualified name of the super class that this
 * node is representing
 */
private void processNode(Attributes attributes, String superClassName) {
    // lets get the class name, and check it if required.
    String serviceName = getAttributeValue(attributes, AndroidManifest.ATTRIBUTE_NAME,
            true /* hasNamespace */);
    if (serviceName != null) {
        serviceName = AndroidManifest.combinePackageAndClassName(mManifestData.mPackage,
                serviceName);

        if (mErrorHandler != null) {
            mErrorHandler.checkClass(mLocator, serviceName, superClassName,
                    false /* testVisibility */);
        }
    }

    String processName = getAttributeValue(attributes, AndroidManifest.ATTRIBUTE_PROCESS,
            true /* hasNamespace */);
    if (processName != null) {
        mManifestData.addProcessName(processName);
    }
}
 
Example 2
Source File: AndroidManifestParser.java    From java-n-IDE-for-Android with Apache License 2.0 6 votes vote down vote up
/**
 * Processes the instrumentation node.
 * @param attributes the attributes for the instrumentation node.
 */
private void processInstrumentationNode(Attributes attributes) {
    // lets get the class name, and check it if required.
    String instrumentationName = getAttributeValue(attributes,
            AndroidManifest.ATTRIBUTE_NAME,
            true /* hasNamespace */);
    if (instrumentationName != null) {
        String instrClassName = AndroidManifest.combinePackageAndClassName(
                mManifestData.mPackage, instrumentationName);
        String targetPackage = getAttributeValue(attributes,
                AndroidManifest.ATTRIBUTE_TARGET_PACKAGE,
                true /* hasNamespace */);
        mManifestData.mInstrumentations.add(
                new Instrumentation(instrClassName, targetPackage));
        if (mErrorHandler != null) {
            mErrorHandler.checkClass(mLocator, instrClassName,
                    SdkConstants.CLASS_INSTRUMENTATION, true /* testVisibility */);
        }
    }
}
 
Example 3
Source File: AndroidManifestParser.java    From javaide with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Processes the service/receiver/provider nodes.
 * @param attributes the attributes for the activity node.
 * @param superClassName the fully qualified name of the super class that this
 * node is representing
 */
private void processNode(Attributes attributes, String superClassName) {
    // lets get the class name, and check it if required.
    String serviceName = getAttributeValue(attributes, AndroidManifest.ATTRIBUTE_NAME,
            true /* hasNamespace */);
    if (serviceName != null) {
        serviceName = AndroidManifest.combinePackageAndClassName(mManifestData.mPackage,
                serviceName);

        if (mErrorHandler != null) {
            mErrorHandler.checkClass(mLocator, serviceName, superClassName,
                    false /* testVisibility */);
        }
    }

    String processName = getAttributeValue(attributes, AndroidManifest.ATTRIBUTE_PROCESS,
            true /* hasNamespace */);
    if (processName != null) {
        mManifestData.addProcessName(processName);
    }
}
 
Example 4
Source File: AndroidManifestParser.java    From javaide with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Processes the instrumentation node.
 * @param attributes the attributes for the instrumentation node.
 */
private void processInstrumentationNode(Attributes attributes) {
    // lets get the class name, and check it if required.
    String instrumentationName = getAttributeValue(attributes,
            AndroidManifest.ATTRIBUTE_NAME,
            true /* hasNamespace */);
    if (instrumentationName != null) {
        String instrClassName = AndroidManifest.combinePackageAndClassName(
                mManifestData.mPackage, instrumentationName);
        String targetPackage = getAttributeValue(attributes,
                AndroidManifest.ATTRIBUTE_TARGET_PACKAGE,
                true /* hasNamespace */);
        mManifestData.mInstrumentations.add(
                new Instrumentation(instrClassName, targetPackage));
        if (mErrorHandler != null) {
            mErrorHandler.checkClass(mLocator, instrClassName,
                    SdkConstants.CLASS_INSTRUMENTATION, true /* testVisibility */);
        }
    }
}
 
Example 5
Source File: AndroidManifestParser.java    From java-n-IDE-for-Android with Apache License 2.0 5 votes vote down vote up
/**
 * Processes the activity node.
 * @param attributes the attributes for the activity node.
 */
private void processActivityNode(Attributes attributes) {
    // lets get the activity name, and add it to the list
    String activityName = getAttributeValue(attributes, AndroidManifest.ATTRIBUTE_NAME,
            true /* hasNamespace */);
    if (activityName != null) {
        activityName = AndroidManifest.combinePackageAndClassName(mManifestData.mPackage,
                activityName);

        // get the exported flag.
        String exportedStr = getAttributeValue(attributes,
                AndroidManifest.ATTRIBUTE_EXPORTED, true);
        boolean exported = exportedStr == null ||
                exportedStr.toLowerCase(Locale.US).equals("true"); //$NON-NLS-1$
        mCurrentActivity = new Activity(activityName, exported);
        mManifestData.mActivities.add(mCurrentActivity);

        if (mErrorHandler != null) {
            mErrorHandler.checkClass(mLocator, activityName, SdkConstants.CLASS_ACTIVITY,
                    true /* testVisibility */);
        }
    } else {
        // no activity found! Aapt will output an error,
        // so we don't have to do anything
        mCurrentActivity = null;
    }

    String processName = getAttributeValue(attributes, AndroidManifest.ATTRIBUTE_PROCESS,
            true /* hasNamespace */);
    if (processName != null) {
        mManifestData.addProcessName(processName);
    }
}
 
Example 6
Source File: AndroidManifestParser.java    From javaide with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Processes the activity node.
 * @param attributes the attributes for the activity node.
 */
private void processActivityNode(Attributes attributes) {
    // lets get the activity name, and add it to the list
    String activityName = getAttributeValue(attributes, AndroidManifest.ATTRIBUTE_NAME,
            true /* hasNamespace */);
    if (activityName != null) {
        activityName = AndroidManifest.combinePackageAndClassName(mManifestData.mPackage,
                activityName);

        // get the exported flag.
        String exportedStr = getAttributeValue(attributes,
                AndroidManifest.ATTRIBUTE_EXPORTED, true);
        boolean exported = exportedStr == null ||
                exportedStr.toLowerCase(Locale.US).equals("true"); //$NON-NLS-1$
        mCurrentActivity = new Activity(activityName, exported);
        mManifestData.mActivities.add(mCurrentActivity);

        if (mErrorHandler != null) {
            mErrorHandler.checkClass(mLocator, activityName, SdkConstants.CLASS_ACTIVITY,
                    true /* testVisibility */);
        }
    } else {
        // no activity found! Aapt will output an error,
        // so we don't have to do anything
        mCurrentActivity = null;
    }

    String processName = getAttributeValue(attributes, AndroidManifest.ATTRIBUTE_PROCESS,
            true /* hasNamespace */);
    if (processName != null) {
        mManifestData.addProcessName(processName);
    }
}