private void fail(String message) throws TemplateException { fErrorMessage= message; throw new TemplateException(message); }
private void fail(String message) throws TemplateException { fErrorMessage= message; throw new TemplateException(message); }
@Override protected void validateVariables(TemplateVariable[] variables) throws TemplateException { // check for multiple cursor variables for (int i= 0; i < variables.length; i++) { TemplateVariable var= variables[i]; if (var.getType().equals(GlobalTemplateVariables.Cursor.NAME)) { if (var.getOffsets().length > 1) { throw new TemplateException(JavaTemplateMessages.ContextType_error_multiple_cursor_variables); } } } }
protected void validateVariables(TemplateVariable[] variables) throws TemplateException { // check for multiple cursor variables for (int i= 0; i < variables.length; i++) { TemplateVariable var= variables[i]; if (var.getType().equals(GlobalTemplateVariables.Cursor.NAME)) { if (var.getOffsets().length > 1) { throw new TemplateException(JavaTemplateMessages.ContextType_error_multiple_cursor_variables); } } } }
@Override protected void validateVariables(TemplateVariable[] variables) throws TemplateException { // check for multiple cursor variables for (int i= 0; i < variables.length; i++) { TemplateVariable var= variables[i]; if (var.getType().equals(GlobalTemplateVariables.Cursor.NAME)) { if (var.getOffsets().length > 1) { throw new TemplateException(JavaTemplateMessages.ContextType_error_multiple_cursor_variables); } } } }
public void validate(String pattern) throws TemplateException { super.validate(pattern); if (fIsComment) { if (!isValidComment(pattern)) { throw new TemplateException(JavaTemplateMessages.CodeTemplateContextType_validate_invalidcomment); } } }
@Override public void validate(String pattern) throws TemplateException { super.validate(pattern); if (fIsComment) { if (!isValidComment(pattern)) { throw new TemplateException(JavaManipulationMessages.CodeTemplateContextType_validate_invalidcomment); } } }
@Override public void validate(String pattern) throws TemplateException { super.validate(pattern); if (fIsComment) { if (!isValidComment(pattern)) { throw new TemplateException(JavaTemplateMessages.CodeTemplateContextType_validate_invalidcomment); } } }
protected void validateVariables(TemplateVariable[] variables) throws TemplateException { ArrayList required= new ArrayList(5); String contextName= getId(); if (NEWTYPE_CONTEXTTYPE.equals(contextName)) { required.add(PACKAGE_DECLARATION); required.add(TYPE_DECLARATION); } for (int i= 0; i < variables.length; i++) { String type= variables[i].getType(); if (getResolver(type) == null) { throw new TemplateException(Messages.format(JavaTemplateMessages.CodeTemplateContextType_validate_unknownvariable, type)); } required.remove(type); } if (!required.isEmpty()) { String missing= (String) required.get(0); throw new TemplateException(Messages.format(JavaTemplateMessages.CodeTemplateContextType_validate_missingvariable, missing)); } super.validateVariables(variables); }
@Override protected void validateVariables(TemplateVariable[] variables) throws TemplateException { ArrayList<String> required= new ArrayList<>(5); String contextName= getId(); if (NEWTYPE_CONTEXTTYPE.equals(contextName)) { required.add(PACKAGE_DECLARATION); required.add(TYPE_DECLARATION); } for (int i= 0; i < variables.length; i++) { String type= variables[i].getType(); if (getResolver(type) == null) { String unknown= BasicElementLabels.getJavaElementName(type); throw new TemplateException(Messages.format(JavaManipulationMessages.CodeTemplateContextType_validate_unknownvariable, unknown)); } required.remove(type); } if (!required.isEmpty()) { String missing= BasicElementLabels.getJavaElementName(required.get(0)); throw new TemplateException(Messages.format(JavaManipulationMessages.CodeTemplateContextType_validate_missingvariable, missing)); } super.validateVariables(variables); }
@Override protected void validateVariables(TemplateVariable[] variables) throws TemplateException { ArrayList<String> required= new ArrayList<>(5); String contextName= getId(); if (NEWTYPE_CONTEXTTYPE.equals(contextName)) { required.add(PACKAGE_DECLARATION); required.add(TYPE_DECLARATION); } for (int i= 0; i < variables.length; i++) { String type= variables[i].getType(); if (getResolver(type) == null) { String unknown= BasicElementLabels.getJavaElementName(type); throw new TemplateException(Messages.format(JavaTemplateMessages.CodeTemplateContextType_validate_unknownvariable, unknown)); } required.remove(type); } if (!required.isEmpty()) { String missing= BasicElementLabels.getJavaElementName(required.get(0)); throw new TemplateException(Messages.format(JavaTemplateMessages.CodeTemplateContextType_validate_missingvariable, missing)); } super.validateVariables(variables); }
throw new TemplateException(JavaTemplateMessages.Context_error_cannot_evaluate);
throw new TemplateException(JavaTemplateMessages.Context_error_cannot_evaluate);
throw new TemplateException(JavaTemplateMessages.Context_error_cannot_evaluate);