Package org.glassfish.gmbal.typelib

Examples of org.glassfish.gmbal.typelib.EvaluatedMethodDeclaration


    return;
      }

      // If there are two methods with @NameValue in the same
      // class, we have an error.
      EvaluatedMethodDeclaration annotatedMethod = annotatedMethods.get(0);
      if (annotatedMethods.size() > 1) {
    EvaluatedMethodDeclaration second = annotatedMethods.get(1);

    if (annotatedMethod.containingClass().equals(
        second.containingClass())) {

    throw Exceptions.self.duplicateObjectNameKeyAttributes(
        annotatedMethod, second,
        annotatedMethod.containingClass().name());
    }
View Full Code Here


    public final TypeConverter tc() { return _tc ; }
   
    public boolean isApplicable( Object obj ) {
        if (_decl instanceof EvaluatedMethodDeclaration) {
            EvaluatedMethodDeclaration em = (EvaluatedMethodDeclaration)_decl ;
            return em.method().getDeclaringClass().isInstance( obj ) ;
        } else if (_decl instanceof EvaluatedFieldDeclaration) {
            EvaluatedFieldDeclaration ef = (EvaluatedFieldDeclaration)_decl ;
            return ef.field().getDeclaringClass().isInstance( obj ) ;
        }
View Full Code Here

               
        Object result = null;
       
        try {
            if (_decl instanceof EvaluatedMethodDeclaration) {
                EvaluatedMethodDeclaration em = (EvaluatedMethodDeclaration)_decl ;
                result = _tc.toManagedEntity( fa.invoke( em.method(), debug ));
            } else if (_decl instanceof EvaluatedFieldDeclaration) {
                EvaluatedFieldDeclaration ef = (EvaluatedFieldDeclaration)_decl ;
                result = _tc.toManagedEntity( fa.get( ef.field(), debug )) ;
            } else {
                Exceptions.self.unknownDeclarationType(_decl) ;
View Full Code Here

       
        mm.enter( debug, "set", target, value ) ;
       
        try {
            if (_decl instanceof EvaluatedMethodDeclaration) {
                EvaluatedMethodDeclaration em =
                    (EvaluatedMethodDeclaration)_decl ;
                target.invoke( em.method(), debug, _tc.fromManagedEntity(value)) ;
            } else if (_decl instanceof EvaluatedFieldDeclaration) {
                EvaluatedFieldDeclaration ef = (EvaluatedFieldDeclaration)_decl ;
                target.set( ef.field(), _tc.fromManagedEntity( value ), debug ) ;
            } else {
                Exceptions.self.unknownDeclarationType(_decl) ;
View Full Code Here

        EvaluatedDeclaration decl ) {

        EvaluatedType evalType = null ;
        AttributeType atype = null ;
        if (decl instanceof EvaluatedMethodDeclaration) {
            EvaluatedMethodDeclaration method =
                (EvaluatedMethodDeclaration)decl ;

            final List<EvaluatedType> atypes = method.parameterTypes() ;

            if (method.returnType().equals( EvaluatedType.EVOID )) {
                if (atypes.size() != 1) {
                    return null ;
                }

                atype = AttributeType.SETTER ;
                evalType = atypes.get(0) ;
            } else {
                if (atypes.size() != 0) {
                    return null ;
                }

                atype = AttributeType.GETTER ;
                evalType = method.returnType() ;
            }
        } else if (decl instanceof EvaluatedFieldDeclaration) {
            EvaluatedFieldDeclaration field = (EvaluatedFieldDeclaration)decl ;

            evalType = field.fieldType() ;
View Full Code Here

    private static EvaluatedType getReturnType( EvaluatedClassDeclaration decl,
        String mname ) {

        EvaluatedClassAnalyzer eca = new EvaluatedClassAnalyzer( decl ) ;
        EvaluatedMethodDeclaration meth = findMethod( eca, mname ) ;

        if (meth == null) {
            return null ;
        } else {
            return meth.returnType() ;
        }
    }
View Full Code Here

    private static EvaluatedType getParameterType(
        EvaluatedClassDeclaration decl, String mname, int pindex ) {

        EvaluatedClassAnalyzer eca = new EvaluatedClassAnalyzer( decl ) ;
        EvaluatedMethodDeclaration meth = findMethod( eca, mname ) ;

        if (meth == null) {
            return null ;
        } else {
            if (pindex < meth.parameterTypes().size()) {
                return meth.parameterTypes().get( pindex ) ;
            } else {
                throw new IndexOutOfBoundsException(
                    "Parameter index is out of bounds" ) ;
            }
        }
View Full Code Here

TOP

Related Classes of org.glassfish.gmbal.typelib.EvaluatedMethodDeclaration

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.