コード例 #1
0
ファイル: LanguageConfig.java プロジェクト: huibo-shi/xtext
 @Override
 public void checkConfiguration(Issues issues) {
   super.checkConfiguration(issues);
   if (isCheckFileExtension()) {
     for (String extension : fileExtensions) {
       char[] charArray = extension.toCharArray();
       if (!Character.isJavaIdentifierPart(charArray[0])) {
         issues.addError(
             "file extension '"
                 + extension
                 + "' starts with a non identifier letter : '"
                 + charArray[0]
                 + "'",
             this);
       }
       for (int i = 1; i < charArray.length; i++) {
         char c = charArray[i];
         if (!Character.isJavaIdentifierPart(c)) {
           issues.addError(
               "file extension '" + extension + "' contains non identifier letter : '" + c + "'",
               this);
         }
       }
     }
   }
   if (getGrammar() == null) {
     issues.addError("property 'uri' is mandatory for element 'language'.", this);
   }
 }
コード例 #2
0
 @Override
 public void checkConfiguration(final Issues issues) {
   super.checkConfiguration(issues);
   if (getOptions().isBacktrackLexer() && getOptions().isIgnoreCase()) {
     issues.addError("Backtracking lexer and ignorecase cannot be combined for now.");
   }
 }
コード例 #3
0
 @Override
 protected void onFinish(WorkflowContext ctx, ProgressMonitor monitor, Issues issues) {
   if (!found) {
     issues.addError("No resource found in the slot");
     return;
   }
   ctx.set(modelSlot, modelElements);
 }
コード例 #4
0
ファイル: DirectoryCleaner.java プロジェクト: eclipse/mwe
 @Override
 protected void invokeInternal(
     final WorkflowContext model, final ProgressMonitor monitor, final Issues issues) {
   if (directory != null) {
     final StringTokenizer st = new StringTokenizer(directory, ",");
     while (st.hasMoreElements()) {
       final String dir = st.nextToken().trim();
       final File f = new File(dir);
       if (f.exists() && f.isDirectory()) {
         LOG.info("Cleaning " + f.getAbsolutePath());
         try {
           cleanFolder(f.getAbsolutePath());
         } catch (FileNotFoundException e) {
           issues.addError(e.getMessage());
         }
       }
     }
   }
 }
コード例 #5
0
ファイル: DirectoryCleaner.java プロジェクト: eclipse/mwe
 @Override
 protected void checkConfigurationInternal(final Issues issues) {
   if (directory == null) {
     issues.addWarning("No directories specified!");
   }
 }
コード例 #6
0
 @Override
 public void checkConfiguration(Issues issues) {
   if (command == null) issues.addError("Command not set");
 }