/** * Subclasses can use this to throw the requisite exception * in isSelected() in the case of an error condition. */ public void validate() { if (getError() == null) { verifySettings(); } if (getError() != null) { throw new BuildException(errmsg, cause); } if (!isReference()) { dieOnCircularReference(); } }
/** * <p>Subclasses can override this method to provide checking of their * state. So long as they call validate() from isSelected(), this will * be called automatically (unless they override validate()).</p> * <p>Implementations should check for incorrect settings and call * setError() as necessary.</p> */ public void verifySettings() { if (isReference()) { getCheckedRef().verifySettings(); } }
/** * Set the project. * @param project the owner of this component. */ @Override public void setProject(Project project) { super.setProject(project); helper.setProjectComponent(this); }
protected synchronized void dieOnCircularReference(Stack<Object> stk, Project p) throws BuildException { if (isChecked()) { return; } if (isReference()) { super.dieOnCircularReference(stk, p); } else { for (FileSelector fileSelector : selectorsList) { if (fileSelector instanceof DataType) { pushAndInvokeCircularReferenceCheck((DataType) fileSelector, stk, p); } } setChecked(true); } } }