Java Code Examples for java.text.ParseException.getErrorOffset()

The following are Jave code examples for showing how to use getErrorOffset() of the java.text.ParseException class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: joai-project   File: SchemEditValidator.java   View Source Code Vote up 6 votes
/**
 *  Gets the entityErrors attribute of the SchemEditValidator object
 *
 * @return    The entityErrors value
 */
public SchemEditActionErrors getEntityErrors() {
	SchemEditActionErrors errors = new SchemEditActionErrors(schemaHelper);
	List errorFields = getInputManager().getEntityErrorFields();
	for (Iterator f = errorFields.iterator(); f.hasNext(); ) {
		InputField field = (InputField) f.next();
		List entityErrors = field.getEntityErrors();
		String errorMsg = "";
		for (Iterator e = entityErrors.iterator(); e.hasNext(); ) {
			ParseException entityError = (ParseException) e.next();
			String ref = "&" + entityError.getMessage().substring(1);
			errorMsg += "<br/>&nbsp;-&nbsp;" + ref + " could not be resolved (at offset " + entityError.getErrorOffset() + ")";
		}
		SchemEditErrors.addEntityError(errors, field, errorMsg);
		docMap.put(field.getXPath(), field.getValue());
		exposeField(field);
	}
	return errors;
}