Package com.strobel.reflection

Examples of com.strobel.reflection.FieldInfo


    // assumes instance is already on the stack
    private void emitMemberGet(final MemberInfo member) {
        switch (member.getMemberType()) {
            case Field:
                final FieldInfo field = (FieldInfo) member;
                if (field.getFieldType().isPrimitive() && field.isStatic() && field.isFinal()) {
                    try {
                        emitConstant(field.getRawField().get(null), field.getFieldType());
                    }
                    catch (IllegalAccessException e) {
                        generator.getField(field);
                    }
                }
View Full Code Here


    public static MemberExpression field(final Type<?> declaringType, final String fieldName) {
        VerifyArgument.notNull(declaringType, "declaringType");
        VerifyArgument.notNull(fieldName, "fieldName");

        final FieldInfo field = findField(
            declaringType,
            fieldName,
            StaticMemberBindingFlags
        );
View Full Code Here

    public static MemberExpression field(final Expression target, final String fieldName) {
        verifyCanRead(target, "target");
        VerifyArgument.notNull(fieldName, "fieldName");

        final FieldInfo field = findField(
            target.getType(),
            fieldName,
            InstanceMemberBindingFlags
        );
View Full Code Here

        switch (expression.getNodeType()) {

            case MemberAccess:
                final MemberExpression memberExpression = (MemberExpression)expression;
                if (memberExpression.getMember() instanceof FieldInfo) {
                    final FieldInfo field = (FieldInfo)memberExpression.getMember();
                    canWrite = !field.isEnumConstant() /*&& !field.isFinal()*/;
                }
                break;

            case Parameter:
                canWrite = true;
View Full Code Here

        return _type;
    }

    @Override
    public Field getRawField() {
        final FieldInfo createdField = getCreatedField();
        return createdField.getRawField();
    }
View Full Code Here

    public static MemberExpression field(final Type<?> declaringType, final String fieldName) {
        VerifyArgument.notNull(declaringType, "declaringType");
        VerifyArgument.notNull(fieldName, "fieldName");

        final FieldInfo field = findField(
            declaringType,
            fieldName,
            StaticMemberBindingFlags
        );
View Full Code Here

    public static MemberExpression field(final Expression target, final String fieldName) {
        verifyCanRead(target, "target");
        VerifyArgument.notNull(fieldName, "fieldName");

        final FieldInfo field = findField(
            target.getType(),
            fieldName,
            InstanceMemberBindingFlags
        );
View Full Code Here

        switch (expression.getNodeType()) {

            case MemberAccess:
                final MemberExpression memberExpression = (MemberExpression)expression;
                if (memberExpression.getMember() instanceof FieldInfo) {
                    final FieldInfo field = (FieldInfo)memberExpression.getMember();
                    canWrite = !field.isEnumConstant() /*&& !field.isFinal()*/;
                }
                break;

            case Parameter:
                canWrite = true;
View Full Code Here

        return makeMemberAccess(target, getMember());
    }

    static MemberExpression make(final Expression expression, final MemberInfo member) {
        if (member.getMemberType() == MemberType.Field) {
            final FieldInfo fi = (FieldInfo) member;
            return new FieldExpression(expression, fi);
        }
        throw Error.memberNotField(member);
    }
View Full Code Here

TOP

Related Classes of com.strobel.reflection.FieldInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.