protected int getBundleStartLevel()

in src/main/java/org/apache/sling/installer/core/impl/tasks/AbstractBundleTask.java [49:74]


    protected int getBundleStartLevel() {
        int startLevel = 0;
        final Object providedLevel;

        if (this.getResource().getDictionary() != null) {
            if ( this.getResource().getDictionary().get(InstallableResource.BUNDLE_START_LEVEL) != null ) {
                providedLevel = this.getResource().getDictionary().get(InstallableResource.BUNDLE_START_LEVEL);
            } else {
                providedLevel = this.getResource().getDictionary().get(InstallableResource.INSTALLATION_HINT);
            }
        } else {
            providedLevel = null;
        }
        if ( providedLevel != null ) {
            if ( providedLevel instanceof Number ) {
                startLevel = ((Number)providedLevel).intValue();
            } else {
                try {
                    startLevel = Integer.valueOf(providedLevel.toString());
                } catch (final NumberFormatException nfe) {
                    // ignore this
                }
            }
        }
        return startLevel;
    }