com.sun.tools.internal.xjc.outline.FieldAccessor Java Examples

The following examples show how to use com.sun.tools.internal.xjc.outline.FieldAccessor. 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: IsSetField.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private void generate( ClassOutlineImpl outline, CPropertyInfo prop ) {
    // add isSetXXX and unsetXXX.
    MethodWriter writer = outline.createMethodWriter();

    JCodeModel codeModel = outline.parent().getCodeModel();

    FieldAccessor acc = core.create(JExpr._this());

    if( generateIsSetMethod ) {
        // [RESULT] boolean isSetXXX()
        JExpression hasSetValue = acc.hasSetValue();
        if( hasSetValue==null ) {
            // this field renderer doesn't support the isSet/unset methods generation.
            // issue an error
            throw new UnsupportedOperationException();
        }
        writer.declareMethod(codeModel.BOOLEAN,"isSet"+this.prop.getName(true))
            .body()._return( hasSetValue );
    }

    if( generateUnSetMethod ) {
        // [RESULT] void unsetXXX()
        acc.unsetValues(
            writer.declareMethod(codeModel.VOID,"unset"+this.prop.getName(true)).body() );
    }
}
 
Example #2
Source File: IsSetField.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
private void generate( ClassOutlineImpl outline, CPropertyInfo prop ) {
    // add isSetXXX and unsetXXX.
    MethodWriter writer = outline.createMethodWriter();

    JCodeModel codeModel = outline.parent().getCodeModel();

    FieldAccessor acc = core.create(JExpr._this());

    if( generateIsSetMethod ) {
        // [RESULT] boolean isSetXXX()
        JExpression hasSetValue = acc.hasSetValue();
        if( hasSetValue==null ) {
            // this field renderer doesn't support the isSet/unset methods generation.
            // issue an error
            throw new UnsupportedOperationException();
        }
        writer.declareMethod(codeModel.BOOLEAN,"isSet"+this.prop.getName(true))
            .body()._return( hasSetValue );
    }

    if( generateUnSetMethod ) {
        // [RESULT] void unsetXXX()
        acc.unsetValues(
            writer.declareMethod(codeModel.VOID,"unset"+this.prop.getName(true)).body() );
    }
}
 
Example #3
Source File: IsSetField.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
private void generate( ClassOutlineImpl outline, CPropertyInfo prop ) {
    // add isSetXXX and unsetXXX.
    MethodWriter writer = outline.createMethodWriter();

    JCodeModel codeModel = outline.parent().getCodeModel();

    FieldAccessor acc = core.create(JExpr._this());

    if( generateIsSetMethod ) {
        // [RESULT] boolean isSetXXX()
        JExpression hasSetValue = acc.hasSetValue();
        if( hasSetValue==null ) {
            // this field renderer doesn't support the isSet/unset methods generation.
            // issue an error
            throw new UnsupportedOperationException();
        }
        writer.declareMethod(codeModel.BOOLEAN,"isSet"+this.prop.getName(true))
            .body()._return( hasSetValue );
    }

    if( generateUnSetMethod ) {
        // [RESULT] void unsetXXX()
        acc.unsetValues(
            writer.declareMethod(codeModel.VOID,"unset"+this.prop.getName(true)).body() );
    }
}
 
Example #4
Source File: IsSetField.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private void generate( ClassOutlineImpl outline, CPropertyInfo prop ) {
    // add isSetXXX and unsetXXX.
    MethodWriter writer = outline.createMethodWriter();

    JCodeModel codeModel = outline.parent().getCodeModel();

    FieldAccessor acc = core.create(JExpr._this());

    if( generateIsSetMethod ) {
        // [RESULT] boolean isSetXXX()
        JExpression hasSetValue = acc.hasSetValue();
        if( hasSetValue==null ) {
            // this field renderer doesn't support the isSet/unset methods generation.
            // issue an error
            throw new UnsupportedOperationException();
        }
        writer.declareMethod(codeModel.BOOLEAN,"isSet"+this.prop.getName(true))
            .body()._return( hasSetValue );
    }

    if( generateUnSetMethod ) {
        // [RESULT] void unsetXXX()
        acc.unsetValues(
            writer.declareMethod(codeModel.VOID,"unset"+this.prop.getName(true)).body() );
    }
}
 
Example #5
Source File: IsSetField.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
private void generate( ClassOutlineImpl outline, CPropertyInfo prop ) {
    // add isSetXXX and unsetXXX.
    MethodWriter writer = outline.createMethodWriter();

    JCodeModel codeModel = outline.parent().getCodeModel();

    FieldAccessor acc = core.create(JExpr._this());

    if( generateIsSetMethod ) {
        // [RESULT] boolean isSetXXX()
        JExpression hasSetValue = acc.hasSetValue();
        if( hasSetValue==null ) {
            // this field renderer doesn't support the isSet/unset methods generation.
            // issue an error
            throw new UnsupportedOperationException();
        }
        writer.declareMethod(codeModel.BOOLEAN,"isSet"+this.prop.getName(true))
            .body()._return( hasSetValue );
    }

    if( generateUnSetMethod ) {
        // [RESULT] void unsetXXX()
        acc.unsetValues(
            writer.declareMethod(codeModel.VOID,"unset"+this.prop.getName(true)).body() );
    }
}
 
Example #6
Source File: IsSetField.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
private void generate( ClassOutlineImpl outline, CPropertyInfo prop ) {
    // add isSetXXX and unsetXXX.
    MethodWriter writer = outline.createMethodWriter();

    JCodeModel codeModel = outline.parent().getCodeModel();

    FieldAccessor acc = core.create(JExpr._this());

    if( generateIsSetMethod ) {
        // [RESULT] boolean isSetXXX()
        JExpression hasSetValue = acc.hasSetValue();
        if( hasSetValue==null ) {
            // this field renderer doesn't support the isSet/unset methods generation.
            // issue an error
            throw new UnsupportedOperationException();
        }
        writer.declareMethod(codeModel.BOOLEAN,"isSet"+this.prop.getName(true))
            .body()._return( hasSetValue );
    }

    if( generateUnSetMethod ) {
        // [RESULT] void unsetXXX()
        acc.unsetValues(
            writer.declareMethod(codeModel.VOID,"unset"+this.prop.getName(true)).body() );
    }
}
 
Example #7
Source File: IsSetField.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private void generate( ClassOutlineImpl outline, CPropertyInfo prop ) {
    // add isSetXXX and unsetXXX.
    MethodWriter writer = outline.createMethodWriter();

    JCodeModel codeModel = outline.parent().getCodeModel();

    FieldAccessor acc = core.create(JExpr._this());

    if( generateIsSetMethod ) {
        // [RESULT] boolean isSetXXX()
        JExpression hasSetValue = acc.hasSetValue();
        if( hasSetValue==null ) {
            // this field renderer doesn't support the isSet/unset methods generation.
            // issue an error
            throw new UnsupportedOperationException();
        }
        writer.declareMethod(codeModel.BOOLEAN,"isSet"+this.prop.getName(true))
            .body()._return( hasSetValue );
    }

    if( generateUnSetMethod ) {
        // [RESULT] void unsetXXX()
        acc.unsetValues(
            writer.declareMethod(codeModel.VOID,"unset"+this.prop.getName(true)).body() );
    }
}
 
Example #8
Source File: IsSetField.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private void generate( ClassOutlineImpl outline, CPropertyInfo prop ) {
    // add isSetXXX and unsetXXX.
    MethodWriter writer = outline.createMethodWriter();

    JCodeModel codeModel = outline.parent().getCodeModel();

    FieldAccessor acc = core.create(JExpr._this());

    if( generateIsSetMethod ) {
        // [RESULT] boolean isSetXXX()
        JExpression hasSetValue = acc.hasSetValue();
        if( hasSetValue==null ) {
            // this field renderer doesn't support the isSet/unset methods generation.
            // issue an error
            throw new UnsupportedOperationException();
        }
        writer.declareMethod(codeModel.BOOLEAN,"isSet"+this.prop.getName(true))
            .body()._return( hasSetValue );
    }

    if( generateUnSetMethod ) {
        // [RESULT] void unsetXXX()
        acc.unsetValues(
            writer.declareMethod(codeModel.VOID,"unset"+this.prop.getName(true)).body() );
    }
}
 
Example #9
Source File: UnboxedField.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public FieldAccessor create(JExpression targetObject) {
    return new Accessor(targetObject) {

        public void unsetValues( JBlock body ) {
            // you can't unset a value
        }

        public JExpression hasSetValue() {
            return JExpr.TRUE;
        }
    };
}
 
Example #10
Source File: UnboxedField.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public FieldAccessor create(JExpression targetObject) {
    return new Accessor(targetObject) {

        public void unsetValues( JBlock body ) {
            // you can't unset a value
        }

        public JExpression hasSetValue() {
            return JExpr.TRUE;
        }
    };
}
 
Example #11
Source File: UnboxedField.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public FieldAccessor create(JExpression targetObject) {
    return new Accessor(targetObject) {

        public void unsetValues( JBlock body ) {
            // you can't unset a value
        }

        public JExpression hasSetValue() {
            return JExpr.TRUE;
        }
    };
}
 
Example #12
Source File: UnboxedField.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public FieldAccessor create(JExpression targetObject) {
    return new Accessor(targetObject) {

        public void unsetValues( JBlock body ) {
            // you can't unset a value
        }

        public JExpression hasSetValue() {
            return JExpr.TRUE;
        }
    };
}
 
Example #13
Source File: UnboxedField.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public FieldAccessor create(JExpression targetObject) {
    return new Accessor(targetObject) {

        public void unsetValues( JBlock body ) {
            // you can't unset a value
        }

        public JExpression hasSetValue() {
            return JExpr.TRUE;
        }
    };
}
 
Example #14
Source File: UnboxedField.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public FieldAccessor create(JExpression targetObject) {
    return new Accessor(targetObject) {

        public void unsetValues( JBlock body ) {
            // you can't unset a value
        }

        public JExpression hasSetValue() {
            return JExpr.TRUE;
        }
    };
}
 
Example #15
Source File: UnboxedField.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public FieldAccessor create(JExpression targetObject) {
    return new Accessor(targetObject) {

        public void unsetValues( JBlock body ) {
            // you can't unset a value
        }

        public JExpression hasSetValue() {
            return JExpr.TRUE;
        }
    };
}
 
Example #16
Source File: UnboxedField.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public FieldAccessor create(JExpression targetObject) {
    return new Accessor(targetObject) {

        public void unsetValues( JBlock body ) {
            // you can't unset a value
        }

        public JExpression hasSetValue() {
            return JExpr.TRUE;
        }
    };
}
 
Example #17
Source File: ElementCollectionAdapter.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public FieldAccessor create(JExpression targetObject) {
    return new FieldAccessorImpl(targetObject);
}
 
Example #18
Source File: SingleField.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public FieldAccessor create(JExpression targetObject) {
    return new Accessor(targetObject);
}
 
Example #19
Source File: ElementSingleAdapter.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public FieldAccessor create(JExpression targetObject) {
    return new FieldAccessorImpl(targetObject);
}
 
Example #20
Source File: ElementCollectionAdapter.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public FieldAccessor create(JExpression targetObject) {
    return new FieldAccessorImpl(targetObject);
}
 
Example #21
Source File: SingleField.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public FieldAccessor create(JExpression targetObject) {
    return new Accessor(targetObject);
}
 
Example #22
Source File: IsSetField.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public FieldAccessor create(JExpression targetObject) {
    return new Accessor(targetObject);
}
 
Example #23
Source File: ConstField.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public FieldAccessor create(JExpression target) {
    return new Accessor(target);
}
 
Example #24
Source File: ConstField.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public FieldAccessor create(JExpression target) {
    return new Accessor(target);
}
 
Example #25
Source File: SingleField.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public FieldAccessor create(JExpression targetObject) {
    return new Accessor(targetObject);
}
 
Example #26
Source File: ElementCollectionAdapter.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public FieldAccessor create(JExpression targetObject) {
    return new FieldAccessorImpl(targetObject);
}
 
Example #27
Source File: IsSetField.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public FieldAccessor create(JExpression targetObject) {
    return new Accessor(targetObject);
}
 
Example #28
Source File: ElementSingleAdapter.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public FieldAccessor create(JExpression targetObject) {
    return new FieldAccessorImpl(targetObject);
}
 
Example #29
Source File: IsSetField.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public FieldAccessor create(JExpression targetObject) {
    return new Accessor(targetObject);
}
 
Example #30
Source File: ElementSingleAdapter.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public FieldAccessor create(JExpression targetObject) {
    return new FieldAccessorImpl(targetObject);
}