You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Ricardo Manuel Saraiva <rm...@advancecare.com> on 2007/04/13 17:53:02 UTC

Access a field

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