Lines Matching refs:returnType

232      * <p>If <code>returnType</code> is not one of the types defined in {@link XPathConstants} (
243 * If <code>expression</code> or <code>returnType</code> is <code>null</code>, then a
248 * @param returnType The desired return type.
250 * @return Result of evaluating an XPath expression as an <code>Object</code> of <code>returnType</code>.
253 * @throws IllegalArgumentException If <code>returnType</code> is not one of the types defined in {@link XPathConstants}.
254 * @throws NullPointerException If <code>expression</code> or <code>returnType</code> is <code>null</code>.
256 public Object evaluate(String expression, Object item, QName returnType)
264 if ( returnType == null ) {
267 new Object[] {"returnType"} );
270 // Checking if requested returnType is supported. returnType need to
272 if ( !isSupported ( returnType ) ) {
275 new Object[] { returnType.toString() } );
282 return getResultAsType( resultObject, returnType );
301 private boolean isSupported( QName returnType ) {
302 if ( ( returnType.equals( XPathConstants.STRING ) ) ||
303 ( returnType.equals( XPathConstants.NUMBER ) ) ||
304 ( returnType.equals( XPathConstants.BOOLEAN ) ) ||
305 ( returnType.equals( XPathConstants.NODE ) ) ||
306 ( returnType.equals( XPathConstants.NODESET ) ) ) {
313 private Object getResultAsType( XObject resultObject, QName returnType )
316 if ( returnType.equals( XPathConstants.STRING ) ) {
320 if ( returnType.equals( XPathConstants.NUMBER ) ) {
324 if ( returnType.equals( XPathConstants.BOOLEAN ) ) {
328 if ( returnType.equals( XPathConstants.NODESET ) ) {
332 if ( returnType.equals( XPathConstants.NODE ) ) {
339 new Object[] { returnType.toString()});
348 * <p>This method calls {@link #evaluate(String expression, Object item, QName returnType)} with a <code>returnType</code> of
418 * {@link #evaluate(String expression, Object item, QName returnType)} on the resulting document object.</p>
424 * <p>If <code>returnType</code> is not one of the types defined in {@link XPathConstants},
427 * <p>If <code>expression</code>, <code>source</code> or <code>returnType</code> is <code>null</code>,
432 * @param returnType The desired return type.
437 * @throws IllegalArgumentException If <code>returnType</code> is not one of the types defined in {@link XPathConstants}.
438 * @throws NullPointerException If <code>expression</code>, <code>source</code> or <code>returnType</code>
442 QName returnType) throws XPathExpressionException {
456 if ( returnType == null ) {
459 new Object[] {"returnType"} );
463 //Checking if requested returnType is supported.
464 //returnType need to be defined in XPathConstants
465 if ( !isSupported ( returnType ) ) {
468 new Object[] { returnType.toString() } );
477 return getResultAsType( resultObject, returnType );
500 * <p>This method calls {@link #evaluate(String expression, InputSource source, QName returnType)} with a
501 * <code>returnType</code> of {@link XPathConstants#STRING}.</p>