public Class getToolClass() { try { return ClassUtils.getClass(getClassname()); } catch (ClassNotFoundException cnfe) { throw new ConfigurationException(this, cnfe); } }
public void validate() { // make sure the key is not null if (getKey() == null) { throw new NullKeyException(this); } // make sure we have value and that it can be converted if (getValue() == null) { throw new ConfigurationException(this, "No value has been set for '"+getKey()+'\''); } else if (this.converter != null) { try { if (getConvertedValue() == null && getValue() != null) { throw new ConfigurationException(this, "Conversion of "+getValue()+" for '"+getKey()+"' failed and returned null"); } } catch (Throwable t) { throw new ConfigurationException(this, t); } } }
@Override public void validate() { super.validate(); // make sure the key is not null if (getKey() == null) { throw new NullKeyException(this); } Status status = getStatus(); switch (status) { case VALID: break; default: throw new ConfigurationException(this, getError(status)); } }
throw new ConfigurationException(this, "Toolbox scope cannot be null"); throw new ConfigurationException(this, "Scope '"+getScope()+"' is not recognized. Please correct or add your new custom scope with "+Scope.class.getName()+".add(\""+getScope()+"\").");
public ToolInfo createInfo() { ToolInfo info = null; Status status = getStatus(); switch (status) { case VALID: info = new ToolInfo(getKey(), getToolClass()); break; default: throw problem == null ? new ConfigurationException(this, getError(status)) : new ConfigurationException(this, getError(status), problem); } info.restrictTo(getRestrictTo()); if (getSkipSetters() != null) { info.setSkipSetters(getSkipSetters()); } // it's ok to use this here, because we know it's the // first time properties have been added to this ToolInfo Map<String,Object> properties = getPropertyMap(); // make sure key is present in properties, even for default properties properties.put(ToolContext.TOOLKEY_KEY, getKey()); info.addProperties(properties); return info; }