FileDocCategorySizeDatePackage
AccessSourcer.javaAPI DocAndroid 1.5 API4074Wed May 06 22:41:10 BST 2009com.android.mkstubs.sourcer

AccessSourcer

public class AccessSourcer extends Object
Source generator for the access fields of methods, fields and classes.

Given an integer access field and a type ({@link #IS_CLASS}, {@link #IS_FIELD} or {@link #IS_METHOD}), the {@link #write(int, int)} method can generate a string desribing the access modifiers for a Java source.

Fields Summary
private final Output
mOutput
public static int
IS_CLASS
public static int
IS_FIELD
public static int
IS_METHOD
Constructors Summary
public AccessSourcer(Output output)

        mOutput = output;
    
Methods Summary
public voidwrite(int access, int filter)
Generates a list of access keywords, e.g. "public final".

It is up to the caller to filter extra keywords that should not be generated, e.g. {@link Flag#ACC_SYNTHETIC}.

param
access The access mode, e.g. 33 or 18
param
filter One of {@link #IS_CLASS}, {@link #IS_FIELD} or {@link #IS_METHOD}, which indicates the validity context.


        boolean need_sep = false;
        
        for (Flag f : Flag.values()) {
            if ((f.getFilter() & filter) != 0 && (access & f.getValue()) != 0) {
                if (need_sep) {
                    mOutput.write(" ");
                }
                mOutput.write(f.toString());
                need_sep = true;
            }
        }