@Override public Function getFunction(String namespaceURI, String prefix, String localName) throws UnresolvableException { if (localName != null && illegalFunctions.contains(localName.toLowerCase(Locale.ENGLISH))) { throw new UnresolvableException("Illegal function: " + localName); } return base.getFunction(namespaceURI, prefix, localName); } }
public Function getFunction(String namespaceURI, String prefix, String localName ) throws UnresolvableException { QualifiedName key = new QualifiedName( namespaceURI, localName ); if ( this.functions.containsKey(key) ) { return (Function) this.functions.get( key ); } else { throw new UnresolvableException( "No Such Function " + key.getClarkForm() ); } } }
public Object getVariableValue( String namespaceURI, String prefix, String localName ) throws UnresolvableException { QualifiedName key = new QualifiedName( namespaceURI, localName ); if ( this.variables.containsKey(key) ) { return this.variables.get( key ); } else { throw new UnresolvableException( "Variable " + key.getClarkForm() ); } } }
/** Retrieve a variable value. * * @param namespaceURI the function namespace URI * @param prefix the function prefix * @param localName the function name * * @return the variable value. * * @throws UnresolvableException if unable to locate a bound variable. */ public Object getVariableValue( String namespaceURI, String prefix, String localName ) throws UnresolvableException { VariableContext context = getVariableContext(); if ( context != null ) { return context.getVariableValue( namespaceURI, prefix, localName ); } else { throw new UnresolvableException( "No variable context installed" ); } }
/** Retrieve a <code>Function</code>. * * @param namespaceURI the function namespace URI * @param prefix the function prefix * @param localName the function name * * @return the function object * * @throws UnresolvableException if unable to locate a bound function */ public Function getFunction( String namespaceURI, String prefix, String localName ) throws UnresolvableException { FunctionContext context = getFunctionContext(); if ( context != null ) { return context.getFunction( namespaceURI, prefix, localName ); } else { throw new UnresolvableException( "No function context installed" ); } }
public Object getVariableValue(String namespaceURI, String prefix, String localName) throws UnresolvableException { try { TemplateModel model = Environment.getCurrentEnvironment().getVariable(localName); if (model == null) { throw new UnresolvableException("Variable \"" + localName + "\" not found."); } if (model instanceof TemplateScalarModel) { return ((TemplateScalarModel) model).getAsString(); } if (model instanceof TemplateNumberModel) { return ((TemplateNumberModel) model).getAsNumber(); } if (model instanceof TemplateDateModel) { return ((TemplateDateModel) model).getAsDate(); } if (model instanceof TemplateBooleanModel) { return Boolean.valueOf(((TemplateBooleanModel) model).getAsBoolean()); } } catch (TemplateModelException e) { throw new UndeclaredThrowableException(e); } throw new UnresolvableException( "Variable \"" + localName + "\" exists, but it's not a string, number, date, or boolean"); } };
uri = support.translateNamespacePrefixToUri(prefix); if (uri == null) { throw new UnresolvableException("XPath expression uses unbound namespace prefix " + prefix); uri = support.translateNamespacePrefixToUri(prefix); if (uri == null) { throw new UnresolvableException("XPath expression uses unbound namespace prefix " + prefix);
myUri = contextSupport.translateNamespacePrefixToUri(this.prefix); if (myUri == null) { throw new UnresolvableException("Cannot resolve namespace prefix '"+this.prefix+"'");
@Override public Object getVariableValue(String namespaceURI, String prefix, String localName) throws UnresolvableException { if (namespaceURI == null) { namespaceURI = ""; } if (prefix == null) { prefix = ""; } try { if ("".equals(namespaceURI)) { namespaceURI = getNamespace(prefix).getURI(); } return getVariable(localName, Namespace.getNamespace(namespaceURI)); } catch (IllegalArgumentException e) { throw new UnresolvableException("Unable to resolve variable " + localName + " in namespace '" + namespaceURI + "' to a vaulue."); } }
@Override public Function getFunction(String namespaceURI, String prefix, String localName) throws UnresolvableException { if (localName != null && illegalFunctions.contains(localName.toLowerCase(Locale.ENGLISH))) { throw new UnresolvableException("Illegal function: " + localName); } return base.getFunction(namespaceURI, prefix, localName); } }
@Override public Object getVariableValue(String namespaceURI, String prefix, String localName) throws UnresolvableException{ Object value = testCase.variableResolver.resolveVariable(new QName(namespaceURI, localName)); if(value==null) throw new UnresolvableException("Unresolvable Variable: "+ ClarkName.valueOf(namespaceURI, localName)); return value; } };
@Override public Function getFunction(String namespaceURI, String prefix, String localName) throws UnresolvableException{ final XPathFunction function = testCase.functionResolver.resolveFunction(new QName(namespaceURI, localName), 0); if(function==null) throw new UnresolvableException("Unresolvable function: "+ ClarkName.valueOf(namespaceURI, localName)); return new Function() { @Override public Object call(Context context, List list) throws FunctionCallException{ try{ return function.evaluate(list); }catch (XPathFunctionException ex){ throw new FunctionCallException(ex); } } }; } };
public Object getVariableValue(String namespaceURI, String prefix, String localName) throws UnresolvableException { try { TemplateModel model = Environment.getCurrentEnvironment().getVariable(localName); if (model == null) { throw new UnresolvableException("Variable \"" + localName + "\" not found."); } if (model instanceof TemplateScalarModel) { return ((TemplateScalarModel) model).getAsString(); } if (model instanceof TemplateNumberModel) { return ((TemplateNumberModel) model).getAsNumber(); } if (model instanceof TemplateDateModel) { return ((TemplateDateModel) model).getAsDate(); } if (model instanceof TemplateBooleanModel) { return Boolean.valueOf(((TemplateBooleanModel) model).getAsBoolean()); } } catch (TemplateModelException e) { throw new UndeclaredThrowableException(e); } throw new UnresolvableException( "Variable \"" + localName + "\" exists, but it's not a string, number, date, or boolean"); } };
public Object getVariableValue(String namespaceURI, String prefix, String localName) throws UnresolvableException { try { TemplateModel model = Environment.getCurrentEnvironment().getVariable(localName); if (model == null) { throw new UnresolvableException("Variable \"" + localName + "\" not found."); } if (model instanceof TemplateScalarModel) { return ((TemplateScalarModel) model).getAsString(); } if (model instanceof TemplateNumberModel) { return ((TemplateNumberModel) model).getAsNumber(); } if (model instanceof TemplateDateModel) { return ((TemplateDateModel) model).getAsDate(); } if (model instanceof TemplateBooleanModel) { return Boolean.valueOf(((TemplateBooleanModel) model).getAsBoolean()); } } catch (TemplateModelException e) { throw new UndeclaredThrowableException(e); } throw new UnresolvableException( "Variable \"" + localName + "\" exists, but it's not a string, number, date, or boolean"); } };
public Object getVariableValue(String namespaceURI, String prefix, String localName) throws UnresolvableException { try { TemplateModel model = Environment.getCurrentEnvironment().getVariable(localName); if(model == null) { throw new UnresolvableException("Variable " + localName + " not found."); } if(model instanceof TemplateScalarModel) { return ((TemplateScalarModel)model).getAsString(); } if(model instanceof TemplateNumberModel) { return ((TemplateNumberModel)model).getAsNumber(); } if(model instanceof TemplateDateModel) { return ((TemplateDateModel)model).getAsDate(); } if(model instanceof TemplateBooleanModel) { return ((TemplateBooleanModel)model).getAsBoolean() ? Boolean.TRUE : Boolean.FALSE; } } catch(TemplateModelException e) { throw new UndeclaredThrowableException(e); } throw new UnresolvableException("Variable " + localName + " is not a string, number, date, or boolean"); } };
" with name " + localName; log.error(msg, e); throw new UnresolvableException( msg + e.getMessage());
" with name " + localName; log.error(msg, e); throw new UnresolvableException( msg + e.getMessage());
+ getExpression()); throw new UnresolvableException("Forced to evaluate with DOM parser bypassing Jaxen");