org.jf.dexlib2.writer.builder.BuilderEncodedValues.BuilderEncodedValue Java Examples

The following examples show how to use org.jf.dexlib2.writer.builder.BuilderEncodedValues.BuilderEncodedValue. 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: BuilderClassPool.java    From HeyGirl with Apache License 2.0 6 votes vote down vote up
@Nullable @Override
public Collection<? extends BuilderEncodedValue> getStaticInitializers(@Nonnull BuilderClassDef classDef) {
    final SortedSet<BuilderField> sortedStaticFields = classDef.getStaticFields();

    final int lastIndex = CollectionUtils.lastIndexOf(sortedStaticFields, HAS_INITIALIZER);
    if (lastIndex > -1) {
        return new AbstractCollection<BuilderEncodedValue>() {
            @Nonnull @Override public Iterator<BuilderEncodedValue> iterator() {
                return FluentIterable.from(sortedStaticFields)
                        .limit(lastIndex+1)
                        .transform(GET_INITIAL_VALUE).iterator();
            }

            @Override public int size() {
                return lastIndex+1;
            }
        };
    }
    return null;
}
 
Example #2
Source File: BuilderClassPool.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
@Nullable @Override
public Collection<? extends BuilderEncodedValue> getStaticInitializers(@Nonnull BuilderClassDef classDef) {
    final SortedSet<BuilderField> sortedStaticFields = classDef.getStaticFields();

    final int lastIndex = CollectionUtils.lastIndexOf(sortedStaticFields, HAS_INITIALIZER);
    if (lastIndex > -1) {
        return new AbstractCollection<BuilderEncodedValue>() {
            @Nonnull @Override public Iterator<BuilderEncodedValue> iterator() {
                return FluentIterable.from(sortedStaticFields)
                        .limit(lastIndex+1)
                        .transform(GET_INITIAL_VALUE).iterator();
            }

            @Override public int size() {
                return lastIndex+1;
            }
        };
    }
    return null;
}
 
Example #3
Source File: BuilderClassPool.java    From ZjDroid with Apache License 2.0 6 votes vote down vote up
@Nullable @Override
public Collection<? extends BuilderEncodedValue> getStaticInitializers(@Nonnull BuilderClassDef classDef) {
    final SortedSet<BuilderField> sortedStaticFields = classDef.getStaticFields();

    final int lastIndex = CollectionUtils.lastIndexOf(sortedStaticFields, HAS_INITIALIZER);
    if (lastIndex > -1) {
        return new AbstractCollection<BuilderEncodedValue>() {
            @Nonnull @Override public Iterator<BuilderEncodedValue> iterator() {
                return FluentIterable.from(sortedStaticFields)
                        .limit(lastIndex+1)
                        .transform(GET_INITIAL_VALUE).iterator();
            }

            @Override public int size() {
                return lastIndex+1;
            }
        };
    }
    return null;
}
 
Example #4
Source File: BuilderClassPool.java    From zjdroid with Apache License 2.0 6 votes vote down vote up
@Nullable @Override
public Collection<? extends BuilderEncodedValue> getStaticInitializers(@Nonnull BuilderClassDef classDef) {
    final SortedSet<BuilderField> sortedStaticFields = classDef.getStaticFields();

    final int lastIndex = CollectionUtils.lastIndexOf(sortedStaticFields, HAS_INITIALIZER);
    if (lastIndex > -1) {
        return new AbstractCollection<BuilderEncodedValue>() {
            @Nonnull @Override public Iterator<BuilderEncodedValue> iterator() {
                return FluentIterable.from(sortedStaticFields)
                        .limit(lastIndex+1)
                        .transform(GET_INITIAL_VALUE).iterator();
            }

            @Override public int size() {
                return lastIndex+1;
            }
        };
    }
    return null;
}
 
Example #5
Source File: BuilderField.java    From HeyGirl with Apache License 2.0 5 votes vote down vote up
BuilderField(@Nonnull BuilderFieldReference fieldReference,
             int accessFlags,
             @Nullable BuilderEncodedValue initialValue,
             @Nonnull BuilderAnnotationSet annotations) {
    this.fieldReference = fieldReference;
    this.accessFlags = accessFlags;
    this.initialValue = initialValue;
    this.annotations = annotations;
}
 
Example #6
Source File: BuilderClassPool.java    From HeyGirl with Apache License 2.0 5 votes vote down vote up
@Override
public BuilderEncodedValue apply(BuilderField input) {
    BuilderEncodedValue initialValue = input.getInitialValue();
    if (initialValue == null) {
        return BuilderEncodedValues.defaultValueForType(input.getType());
    }
    return initialValue;
}
 
Example #7
Source File: BuilderClassPool.java    From ZjDroid with Apache License 2.0 5 votes vote down vote up
@Override
public BuilderEncodedValue apply(BuilderField input) {
    BuilderEncodedValue initialValue = input.getInitialValue();
    if (initialValue == null) {
        return BuilderEncodedValues.defaultValueForType(input.getType());
    }
    return initialValue;
}
 
Example #8
Source File: BuilderField.java    From zjdroid with Apache License 2.0 5 votes vote down vote up
BuilderField(@Nonnull BuilderFieldReference fieldReference,
             int accessFlags,
             @Nullable BuilderEncodedValue initialValue,
             @Nonnull BuilderAnnotationSet annotations) {
    this.fieldReference = fieldReference;
    this.accessFlags = accessFlags;
    this.initialValue = initialValue;
    this.annotations = annotations;
}
 
Example #9
Source File: BuilderClassPool.java    From zjdroid with Apache License 2.0 5 votes vote down vote up
@Override
public BuilderEncodedValue apply(BuilderField input) {
    BuilderEncodedValue initialValue = input.getInitialValue();
    if (initialValue == null) {
        return BuilderEncodedValues.defaultValueForType(input.getType());
    }
    return initialValue;
}
 
Example #10
Source File: BuilderField.java    From ZjDroid with Apache License 2.0 5 votes vote down vote up
BuilderField(@Nonnull BuilderFieldReference fieldReference,
             int accessFlags,
             @Nullable BuilderEncodedValue initialValue,
             @Nonnull BuilderAnnotationSet annotations) {
    this.fieldReference = fieldReference;
    this.accessFlags = accessFlags;
    this.initialValue = initialValue;
    this.annotations = annotations;
}
 
Example #11
Source File: BuilderField.java    From ZjDroid with Apache License 2.0 5 votes vote down vote up
BuilderField(@Nonnull BuilderFieldReference fieldReference,
             int accessFlags,
             @Nullable BuilderEncodedValue initialValue,
             @Nonnull BuilderAnnotationSet annotations) {
    this.fieldReference = fieldReference;
    this.accessFlags = accessFlags;
    this.initialValue = initialValue;
    this.annotations = annotations;
}
 
Example #12
Source File: BuilderClassPool.java    From ZjDroid with Apache License 2.0 5 votes vote down vote up
@Override
public BuilderEncodedValue apply(BuilderField input) {
    BuilderEncodedValue initialValue = input.getInitialValue();
    if (initialValue == null) {
        return BuilderEncodedValues.defaultValueForType(input.getType());
    }
    return initialValue;
}
 
Example #13
Source File: BuilderAnnotationPool.java    From ZjDroid with Apache License 2.0 4 votes vote down vote up
@Nonnull @Override
public BuilderEncodedValue getElementValue(@Nonnull BuilderAnnotationElement element) {
    return element.value;
}
 
Example #14
Source File: BuilderAnnotationElement.java    From ZjDroid with Apache License 2.0 4 votes vote down vote up
public BuilderAnnotationElement(@Nonnull BuilderStringReference name, @Nonnull BuilderEncodedValue value) {
    this.name = name;
    this.value = value;
}
 
Example #15
Source File: BuilderAnnotationElement.java    From ZjDroid with Apache License 2.0 4 votes vote down vote up
public BuilderAnnotationElement(@Nonnull BuilderStringReference name, @Nonnull BuilderEncodedValue value) {
    this.name = name;
    this.value = value;
}
 
Example #16
Source File: BuilderField.java    From HeyGirl with Apache License 2.0 4 votes vote down vote up
@Nullable @Override public BuilderEncodedValue getInitialValue() {
    return initialValue;
}
 
Example #17
Source File: BuilderField.java    From ZjDroid with Apache License 2.0 4 votes vote down vote up
@Nullable @Override public BuilderEncodedValue getInitialValue() {
    return initialValue;
}
 
Example #18
Source File: BuilderAnnotationPool.java    From HeyGirl with Apache License 2.0 4 votes vote down vote up
@Nonnull @Override
public BuilderEncodedValue getElementValue(@Nonnull BuilderAnnotationElement element) {
    return element.value;
}
 
Example #19
Source File: BuilderAnnotationElement.java    From HeyGirl with Apache License 2.0 4 votes vote down vote up
public BuilderAnnotationElement(@Nonnull BuilderStringReference name, @Nonnull BuilderEncodedValue value) {
    this.name = name;
    this.value = value;
}
 
Example #20
Source File: BuilderField.java    From zjdroid with Apache License 2.0 4 votes vote down vote up
@Nullable @Override public BuilderEncodedValue getInitialValue() {
    return initialValue;
}
 
Example #21
Source File: BuilderAnnotationPool.java    From zjdroid with Apache License 2.0 4 votes vote down vote up
@Nonnull @Override
public BuilderEncodedValue getElementValue(@Nonnull BuilderAnnotationElement element) {
    return element.value;
}
 
Example #22
Source File: BuilderAnnotationElement.java    From zjdroid with Apache License 2.0 4 votes vote down vote up
public BuilderAnnotationElement(@Nonnull BuilderStringReference name, @Nonnull BuilderEncodedValue value) {
    this.name = name;
    this.value = value;
}
 
Example #23
Source File: BuilderField.java    From ZjDroid with Apache License 2.0 4 votes vote down vote up
@Nullable @Override public BuilderEncodedValue getInitialValue() {
    return initialValue;
}
 
Example #24
Source File: BuilderAnnotationPool.java    From ZjDroid with Apache License 2.0 4 votes vote down vote up
@Nonnull @Override
public BuilderEncodedValue getElementValue(@Nonnull BuilderAnnotationElement element) {
    return element.value;
}