public static RSM parseRSM ( Element queryElement ) { RSM rsm = new RSM ( ) ; Element setElement = queryElement . element ( "set" ) ; if ( setElement == null ) { return rsm ; } Element after = setElement . element ( "after" ) ; if ( after != null ) { rsm . setAfter ( after . getText ( ) ) ; } Element before = setElement . element ( "before" ) ; if ( before != null ) { String beforeText = before . getText ( ) ; rsm . setBefore ( beforeText == null ? "" : beforeText ) ; } Element index = setElement . element ( "index" ) ; if ( index != null ) { rsm . setIndex ( Integer . parseInt ( index . getText ( ) ) ) ; } Element max = setElement . element ( "max" ) ; if ( max != null ) { rsm . setMax ( Integer . parseInt ( max . getText ( ) ) ) ; } return rsm ; }
Parses an RSM from a query XML element