commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ricardo Manuel Saraiva" <...@advancecare.com>
Subject Access a field
Date Fri, 13 Apr 2007 15:53:02 GMT
Hi,

Is it possible to access a field inside another field?

For example:

<OUT>
            <A/>
	<B>bbb</B>
	<C>
		<D>23</D>
	</C>
	<C>
		<D>0</D>
	</C>
<OUT/>

I want to access the "D" values... in order to apply a validation class:

public class Validator {

public Validator() {
}

public static boolean isPositive(Object bean, Field field) {
	  return new Integer(ValidatorUtils.getValueAsString(bean, field
			    .getProperty())).intValue() > 0;
	 }
}

Thanks,
Ricardo Saraiva


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message