container/common/src/main/java/org/mobicents/slee/container/deployment/ClassUtils.java
public static Set getCMPFields(CtClass clazz) {

        Set properties = new HashSet();

	    // Apply some reflection to the current class.
        
	    // First get an array of all the public methods at this level
	    Set methods = getPublicAbstractMethods(clazz);
	    
	    // remove non-public methods

	    Iterator iter = methods.iterator();

	    // the key in the getter/setter tables will be method name
	    HashMap getters = new HashMap();
	    HashMap setters = new HashMap();
	    
	    // split out getters and setters; ignore the rest
	    while (iter.hasNext()) {
	        CtMethod method = (CtMethod)iter.next();
	        String mname = method.getName();
	        
	        // skip static methods
	        if (Modifier.isStatic(method.getModifiers())) continue;
	        
	        String property = "";
	        try {
		        // skip methods, which throw exceptions
		        if (method.getExceptionTypes().length > 0) continue;

		        if (mname.startsWith(GET_PREFIX)) { 
		            property = mname.substring(GET_PREFIX.length());
		            getters.put(property, method); 
		        } else if (mname.startsWith(IS_PREFIX) && method.getReturnType().equals(CtClass.booleanType)) { 
		            property = mname.substring(IS_PREFIX.length());
		            getters.put(property, method);  
		        } else if (mname.startsWith(SET_PREFIX)) { 
		            property = mname.substring(SET_PREFIX.length());
		            setters.put(property, method);  
		        }
	        } catch (NotFoundException e) {
	            logger.warn(e);
	        }
            if (property.length() == 0 || !Character.isUpperCase(property.charAt(0)) || property.equals(PUBLIC_IDENTIFIER)) {
                logger.warn("Method " + mname + " has a non-capitalized first character of the JavaBean property.");
                getters.remove(property);
                setters.remove(property);
            }
		}

	    // iterate over getters and find matching setters
	    iter = getters.entrySet().iterator();
	    while (iter.hasNext()) {
	        Map.Entry entry = (Map.Entry)iter.next();
	        String property = (String)entry.getKey();
	        CtMethod getter = (CtMethod)entry.getValue();
	        // find matching setter
	        CtMethod setter = (CtMethod)setters.get(property);
	        // if setter is null, the property is not full access (read&write), therefore ignored 
	        try {
		        if (setter != null) {
		            CtClass[] sparams = setter.getParameterTypes();
		            if (sparams.length == 1 && sparams[0].equals(getter.getReturnType())) {
		                properties.add(property);
		            }
		        }
	        } catch (NotFoundException e) {
	            logger.warn(e);
	        }
		}
	    return properties;
    }
public static Set getCMPFields(CtClass clazz) {

        Set properties = new HashSet();

	    // Apply some reflection to the current class.
        
	    // First get an array of all the public methods at this level
	    Set methods = getPublicAbstractMethods(clazz);
	    
	    // remove non-public methods

	    Iterator iter = methods.iterator();

	    // the key in the getter/setter tables will be method name
	    HashMap getters = new HashMap();
	    HashMap setters = new HashMap();
	    
	    // split out getters and setters; ignore the rest
	    while (iter.hasNext()) {
	        CtMethod method = (CtMethod)iter.next();
	        String mname = method.getName();
	        
	        // skip static methods
	        if (Modifier.isStatic(method.getModifiers())) continue;
	        
	        String property = "";
	        try {
		        // skip methods, which throw exceptions
		        if (method.getExceptionTypes().length > 0) continue;

		        if (mname.startsWith(GET_PREFIX)) { 
		            property = mname.substring(GET_PREFIX.length());
		            getters.put(property, method); 
		        } else if (mname.startsWith(IS_PREFIX) && method.getReturnType().equals(CtClass.booleanType)) { 
		            property = mname.substring(IS_PREFIX.length());
		            getters.put(property, method);  
		        } else if (mname.startsWith(SET_PREFIX)) { 
		            property = mname.substring(SET_PREFIX.length());
		            setters.put(property, method);  
		        }
	        } catch (NotFoundException e) {
	            logger.warn(e);
	        }
            if (property.length() == 0 || !Character.isUpperCase(property.charAt(0)) || property.equals(PUBLIC_IDENTIFIER)) {
                logger.warn("Method " + mname + " has a non-capitalized first character of the JavaBean property.");
                getters.remove(property);
                setters.remove(property);
            }
		}

	    // iterate over getters and find matching setters
	    iter = getters.entrySet().iterator();
	    while (iter.hasNext()) {
	        Map.Entry entry = (Map.Entry)iter.next();
	        String property = (String)entry.getKey();
	        CtMethod getter = (CtMethod)entry.getValue();
	        // find matching setter
	        CtMethod setter = (CtMethod)setters.get(property);
	        // if setter is null, the property is not full access (read&write), therefore ignored 
	        try {
		        if (setter != null) {
		            CtClass[] sparams = setter.getParameterTypes();
		            if (sparams.length == 1 && sparams[0].equals(getter.getReturnType())) {
		                properties.add(property);
		            }
		        }
	        } catch (NotFoundException e) {
	            logger.warn(e);
	        }
		}
	    return properties;
    }
public static Set getCMPFields ( CtClass clazz ) { Set properties = new HashSet ( ) ; // Apply some reflection to the current class. // First get an array of all the public methods at this level Set methods = getPublicAbstractMethods ( clazz ) ; // remove non-public methods Iterator iter = methods . iterator ( ) ; // the key in the getter/setter tables will be method name HashMap getters = new HashMap ( ) ; HashMap setters = new HashMap ( ) ; // split out getters and setters; ignore the rest while ( iter . hasNext ( ) ) { CtMethod method = ( CtMethod ) iter . next ( ) ; String mname = method . getName ( ) ; // skip static methods if ( Modifier . isStatic ( method . getModifiers ( ) ) ) continue ; String property = "" ; try { // skip methods, which throw exceptions if ( method . getExceptionTypes ( ) . length > 0 ) continue ; if ( mname . startsWith ( GET_PREFIX ) ) { property = mname . substring ( GET_PREFIX . length ( ) ) ; getters . put ( property , method ) ; } else if ( mname . startsWith ( IS_PREFIX ) && method . getReturnType ( ) . equals ( CtClass . booleanType ) ) { property = mname . substring ( IS_PREFIX . length ( ) ) ; getters . put ( property , method ) ; } else if ( mname . startsWith ( SET_PREFIX ) ) { property = mname . substring ( SET_PREFIX . length ( ) ) ; setters . put ( property , method ) ; } } catch ( NotFoundException e ) { logger . warn ( e ) ; } if ( property . length ( ) == 0 || ! Character . isUpperCase ( property . charAt ( 0 ) ) || property . equals ( PUBLIC_IDENTIFIER ) ) { logger . warn ( "Method " + mname + " has a non-capitalized first character of the JavaBean property." ) ; getters . remove ( property ) ; setters . remove ( property ) ; } } // iterate over getters and find matching setters iter = getters . entrySet ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { Map . Entry entry = ( Map . Entry ) iter . next ( ) ; String property = ( String ) entry . getKey ( ) ; CtMethod getter = ( CtMethod ) entry . getValue ( ) ; // find matching setter CtMethod setter = ( CtMethod ) setters . get ( property ) ; // if setter is null, the property is not full access (read&write), therefore ignored  try { if ( setter != null ) { CtClass [ ] sparams = setter . getParameterTypes ( ) ; if ( sparams . length == 1 && sparams [ 0 ] . equals ( getter . getReturnType ( ) ) ) { properties . add ( property ) ; } } } catch ( NotFoundException e ) { logger . warn ( e ) ; } } return properties ; }
Returns the set of names representing valid, full access (read&write) JavaBean properties declared in the given class.
NOTE: the implementation is not as strict as in Introspector (@see java.beans.Introspector#getTargetPropertyInfo()). It probably should be.

@param CtClass the class metadata
@return Set of names representing valid, full access (read&write) JavaBean properties declared in the given class
@throws NotFoundException if a class type could not be found
Returns the set of names representing valid full access ( read&write ) JavaBean properties declared in the given class . NOTE : the implementation is not as strict as in Introspector ( @see java . beans . Introspector#getTargetPropertyInfo () ) . It probably should be .