repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
sarl/sarl
main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/textmate/TextMateGenerator2.java
TextMateGenerator2.generatePlistFile
protected void generatePlistFile(CombinedTmAppendable it) { final String language = getLanguageSimpleName().toLowerCase(); final String newBasename = getBasename(MessageFormat.format(BASENAME_PATTERN_NEW, language)); writeFile(newBasename, it.getNewSyntaxContent()); }
java
protected void generatePlistFile(CombinedTmAppendable it) { final String language = getLanguageSimpleName().toLowerCase(); final String newBasename = getBasename(MessageFormat.format(BASENAME_PATTERN_NEW, language)); writeFile(newBasename, it.getNewSyntaxContent()); }
[ "protected", "void", "generatePlistFile", "(", "CombinedTmAppendable", "it", ")", "{", "final", "String", "language", "=", "getLanguageSimpleName", "(", ")", ".", "toLowerCase", "(", ")", ";", "final", "String", "newBasename", "=", "getBasename", "(", "MessageForm...
Generate the Plist file. @param it the appendable used for generated the "tmLanguage" file.
[ "Generate", "the", "Plist", "file", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/textmate/TextMateGenerator2.java#L210-L214
train
sarl/sarl
main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/textmate/TextMateGenerator2.java
TextMateGenerator2.generateLicenseFile
protected void generateLicenseFile() { final CharSequence licenseText = getLicenseText(); if (licenseText != null) { final String text = licenseText.toString(); if (!Strings.isEmpty(text)) { writeFile(LICENSE_FILE, text.getBytes()); } } }
java
protected void generateLicenseFile() { final CharSequence licenseText = getLicenseText(); if (licenseText != null) { final String text = licenseText.toString(); if (!Strings.isEmpty(text)) { writeFile(LICENSE_FILE, text.getBytes()); } } }
[ "protected", "void", "generateLicenseFile", "(", ")", "{", "final", "CharSequence", "licenseText", "=", "getLicenseText", "(", ")", ";", "if", "(", "licenseText", "!=", "null", ")", "{", "final", "String", "text", "=", "licenseText", ".", "toString", "(", ")...
Generate the LICENSE file.
[ "Generate", "the", "LICENSE", "file", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/textmate/TextMateGenerator2.java#L218-L226
train
sarl/sarl
main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/textmate/TextMateGenerator2.java
TextMateGenerator2.getLicenseText
protected CharSequence getLicenseText() { final URL url = getClass().getResource(LICENSE_FILE); if (url != null) { final File filename = new File(url.getPath()); try { return Files.toString(filename, Charset.defaultCharset()); } catch (IOException exception) { throw new RuntimeException(exception); } } return null; }
java
protected CharSequence getLicenseText() { final URL url = getClass().getResource(LICENSE_FILE); if (url != null) { final File filename = new File(url.getPath()); try { return Files.toString(filename, Charset.defaultCharset()); } catch (IOException exception) { throw new RuntimeException(exception); } } return null; }
[ "protected", "CharSequence", "getLicenseText", "(", ")", "{", "final", "URL", "url", "=", "getClass", "(", ")", ".", "getResource", "(", "LICENSE_FILE", ")", ";", "if", "(", "url", "!=", "null", ")", "{", "final", "File", "filename", "=", "new", "File", ...
Replies the text of the license to write to the generated output. @return the text.
[ "Replies", "the", "text", "of", "the", "license", "to", "write", "to", "the", "generated", "output", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/textmate/TextMateGenerator2.java#L232-L243
train
sarl/sarl
main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/textmate/TextMateGenerator2.java
TextMateGenerator2.createPatterns
protected List<?> createPatterns(Set<String> literals, Set<String> expressionKeywords, Set<String> modifiers, Set<String> primitiveTypes, Set<String> punctuation, Set<String> ignored, Set<String> specialKeywords, Set<String> typeDeclarationKeywords) { final List<Map<String, ?>> patterns = new ArrayList<>(); patterns.addAll(generateComments()); patterns.addAll(generateStrings()); patterns.addAll(generateNumericConstants()); patterns.addAll(generateAnnotations()); patterns.addAll(generateLiterals(literals)); patterns.addAll(generatePrimitiveTypes(primitiveTypes)); patterns.addAll(generateSpecialKeywords(specialKeywords)); patterns.addAll(generateModifiers(modifiers)); patterns.addAll(generateTypeDeclarations(typeDeclarationKeywords)); patterns.addAll(generateStandardKeywords(expressionKeywords)); patterns.addAll(generatePunctuation(punctuation)); return patterns; }
java
protected List<?> createPatterns(Set<String> literals, Set<String> expressionKeywords, Set<String> modifiers, Set<String> primitiveTypes, Set<String> punctuation, Set<String> ignored, Set<String> specialKeywords, Set<String> typeDeclarationKeywords) { final List<Map<String, ?>> patterns = new ArrayList<>(); patterns.addAll(generateComments()); patterns.addAll(generateStrings()); patterns.addAll(generateNumericConstants()); patterns.addAll(generateAnnotations()); patterns.addAll(generateLiterals(literals)); patterns.addAll(generatePrimitiveTypes(primitiveTypes)); patterns.addAll(generateSpecialKeywords(specialKeywords)); patterns.addAll(generateModifiers(modifiers)); patterns.addAll(generateTypeDeclarations(typeDeclarationKeywords)); patterns.addAll(generateStandardKeywords(expressionKeywords)); patterns.addAll(generatePunctuation(punctuation)); return patterns; }
[ "protected", "List", "<", "?", ">", "createPatterns", "(", "Set", "<", "String", ">", "literals", ",", "Set", "<", "String", ">", "expressionKeywords", ",", "Set", "<", "String", ">", "modifiers", ",", "Set", "<", "String", ">", "primitiveTypes", ",", "S...
Create the patterns. @param literals the SARL literals. @param expressionKeywords the SARL keywords, usually within expressions. @param modifiers the modifier keywords. @param primitiveTypes the primitive types. @param punctuation the SARL punctuation symbols. @param ignored the ignored literals (mostly for information). @param specialKeywords the keywords that are marked as special. They are also in keywords. @param typeDeclarationKeywords the keywords that are marked as type declaration keywords. They are also in keywords. @return the patterns.
[ "Create", "the", "patterns", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/textmate/TextMateGenerator2.java#L257-L280
train
sarl/sarl
main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/textmate/TextMateGenerator2.java
TextMateGenerator2.generateAnnotations
protected List<Map<String, ?>> generateAnnotations() { final List<Map<String, ?>> list = new ArrayList<>(); list.add(pattern(it -> { it.matches("\\@[_a-zA-Z$][_0-9a-zA-Z$]*"); //$NON-NLS-1$ it.style(ANNOTATION_STYLE); it.comment("Annotations"); //$NON-NLS-1$ })); return list; }
java
protected List<Map<String, ?>> generateAnnotations() { final List<Map<String, ?>> list = new ArrayList<>(); list.add(pattern(it -> { it.matches("\\@[_a-zA-Z$][_0-9a-zA-Z$]*"); //$NON-NLS-1$ it.style(ANNOTATION_STYLE); it.comment("Annotations"); //$NON-NLS-1$ })); return list; }
[ "protected", "List", "<", "Map", "<", "String", ",", "?", ">", ">", "generateAnnotations", "(", ")", "{", "final", "List", "<", "Map", "<", "String", ",", "?", ">", ">", "list", "=", "new", "ArrayList", "<>", "(", ")", ";", "list", ".", "add", "(...
Generate the rules for the annotations. @return the rules.
[ "Generate", "the", "rules", "for", "the", "annotations", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/textmate/TextMateGenerator2.java#L286-L294
train
sarl/sarl
main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/textmate/TextMateGenerator2.java
TextMateGenerator2.generateComments
protected List<Map<String, ?>> generateComments() { final List<Map<String, ?>> list = new ArrayList<>(); // Block comment list.add(pattern(it -> { it.delimiters("(/\\*+)", "(\\*/)"); //$NON-NLS-1$ //$NON-NLS-2$ it.style(BLOCK_COMMENT_STYLE); it.beginStyle(BLOCK_COMMENT_DELIMITER_STYLE); it.endStyle(BLOCK_COMMENT_DELIMITER_STYLE); it.pattern(it2 -> { it2.matches("^\\s*(\\*)(?!/)"); //$NON-NLS-1$ it2.style(BLOCK_COMMENT_DELIMITER_STYLE); }); it.comment("Multiline comments"); //$NON-NLS-1$ })); // Line comment list.add(pattern(it -> { it.matches("\\s*(//)(.*)$"); //$NON-NLS-1$ it.substyle(1, LINE_COMMENT_DELIMITER_STYLE); it.substyle(2, LINE_COMMENT_STYLE); it.comment("Single-line comment"); //$NON-NLS-1$ })); return list; }
java
protected List<Map<String, ?>> generateComments() { final List<Map<String, ?>> list = new ArrayList<>(); // Block comment list.add(pattern(it -> { it.delimiters("(/\\*+)", "(\\*/)"); //$NON-NLS-1$ //$NON-NLS-2$ it.style(BLOCK_COMMENT_STYLE); it.beginStyle(BLOCK_COMMENT_DELIMITER_STYLE); it.endStyle(BLOCK_COMMENT_DELIMITER_STYLE); it.pattern(it2 -> { it2.matches("^\\s*(\\*)(?!/)"); //$NON-NLS-1$ it2.style(BLOCK_COMMENT_DELIMITER_STYLE); }); it.comment("Multiline comments"); //$NON-NLS-1$ })); // Line comment list.add(pattern(it -> { it.matches("\\s*(//)(.*)$"); //$NON-NLS-1$ it.substyle(1, LINE_COMMENT_DELIMITER_STYLE); it.substyle(2, LINE_COMMENT_STYLE); it.comment("Single-line comment"); //$NON-NLS-1$ })); return list; }
[ "protected", "List", "<", "Map", "<", "String", ",", "?", ">", ">", "generateComments", "(", ")", "{", "final", "List", "<", "Map", "<", "String", ",", "?", ">", ">", "list", "=", "new", "ArrayList", "<>", "(", ")", ";", "// Block comment", "list", ...
Generate the rules for the comments. @return the rules.
[ "Generate", "the", "rules", "for", "the", "comments", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/textmate/TextMateGenerator2.java#L300-L322
train
sarl/sarl
main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/textmate/TextMateGenerator2.java
TextMateGenerator2.generateStrings
protected List<Map<String, ?>> generateStrings() { final List<Map<String, ?>> list = new ArrayList<>(); // Double quote list.add(pattern(it -> { it.delimiters("\"", "\""); //$NON-NLS-1$ //$NON-NLS-2$ it.style(DOUBLE_QUOTE_STRING_STYLE); it.beginStyle(STRING_BEGIN_STYLE); it.endStyle(STRING_END_STYLE); it.pattern(it2 -> { it2.matches("\\\\."); //$NON-NLS-1$ it2.style(ESCAPE_CHARACTER_STYLE); }); it.comment("Double quoted strings of characters"); //$NON-NLS-1$ })); // Single quote list.add(pattern(it -> { it.delimiters("'", "'"); //$NON-NLS-1$ //$NON-NLS-2$ it.style(SINGLE_QUOTE_STRING_STYLE); it.beginStyle(STRING_BEGIN_STYLE); it.endStyle(STRING_END_STYLE); it.pattern(it2 -> { it2.matches("\\\\."); //$NON-NLS-1$ it2.style(ESCAPE_CHARACTER_STYLE); }); it.comment("Single quoted strings of characters"); //$NON-NLS-1$ })); return list; }
java
protected List<Map<String, ?>> generateStrings() { final List<Map<String, ?>> list = new ArrayList<>(); // Double quote list.add(pattern(it -> { it.delimiters("\"", "\""); //$NON-NLS-1$ //$NON-NLS-2$ it.style(DOUBLE_QUOTE_STRING_STYLE); it.beginStyle(STRING_BEGIN_STYLE); it.endStyle(STRING_END_STYLE); it.pattern(it2 -> { it2.matches("\\\\."); //$NON-NLS-1$ it2.style(ESCAPE_CHARACTER_STYLE); }); it.comment("Double quoted strings of characters"); //$NON-NLS-1$ })); // Single quote list.add(pattern(it -> { it.delimiters("'", "'"); //$NON-NLS-1$ //$NON-NLS-2$ it.style(SINGLE_QUOTE_STRING_STYLE); it.beginStyle(STRING_BEGIN_STYLE); it.endStyle(STRING_END_STYLE); it.pattern(it2 -> { it2.matches("\\\\."); //$NON-NLS-1$ it2.style(ESCAPE_CHARACTER_STYLE); }); it.comment("Single quoted strings of characters"); //$NON-NLS-1$ })); return list; }
[ "protected", "List", "<", "Map", "<", "String", ",", "?", ">", ">", "generateStrings", "(", ")", "{", "final", "List", "<", "Map", "<", "String", ",", "?", ">", ">", "list", "=", "new", "ArrayList", "<>", "(", ")", ";", "// Double quote", "list", "...
Generates the rules for the strings of characters. @return the rules.
[ "Generates", "the", "rules", "for", "the", "strings", "of", "characters", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/textmate/TextMateGenerator2.java#L328-L355
train
sarl/sarl
main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/textmate/TextMateGenerator2.java
TextMateGenerator2.generateNumericConstants
protected List<Map<String, ?>> generateNumericConstants() { final List<Map<String, ?>> list = new ArrayList<>(); list.add(pattern(it -> { it.matches( "(?:" //$NON-NLS-1$ + "[0-9][0-9]*\\.[0-9]+([eE][0-9]+)?[fFdD]?" //$NON-NLS-1$ + ")|(?:" //$NON-NLS-1$ + "0[xX][0-9a-fA-F]+" //$NON-NLS-1$ + ")|(?:" //$NON-NLS-1$ + "[0-9]+[lL]?" //$NON-NLS-1$ + ")"); //$NON-NLS-1$ it.style(NUMBER_STYLE); it.comment("Numbers"); //$NON-NLS-1$ })); return list; }
java
protected List<Map<String, ?>> generateNumericConstants() { final List<Map<String, ?>> list = new ArrayList<>(); list.add(pattern(it -> { it.matches( "(?:" //$NON-NLS-1$ + "[0-9][0-9]*\\.[0-9]+([eE][0-9]+)?[fFdD]?" //$NON-NLS-1$ + ")|(?:" //$NON-NLS-1$ + "0[xX][0-9a-fA-F]+" //$NON-NLS-1$ + ")|(?:" //$NON-NLS-1$ + "[0-9]+[lL]?" //$NON-NLS-1$ + ")"); //$NON-NLS-1$ it.style(NUMBER_STYLE); it.comment("Numbers"); //$NON-NLS-1$ })); return list; }
[ "protected", "List", "<", "Map", "<", "String", ",", "?", ">", ">", "generateNumericConstants", "(", ")", "{", "final", "List", "<", "Map", "<", "String", ",", "?", ">", ">", "list", "=", "new", "ArrayList", "<>", "(", ")", ";", "list", ".", "add",...
Generate the rules for the numeric constants. @return the rules.
[ "Generate", "the", "rules", "for", "the", "numeric", "constants", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/textmate/TextMateGenerator2.java#L361-L376
train
sarl/sarl
main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/textmate/TextMateGenerator2.java
TextMateGenerator2.generatePrimitiveTypes
protected List<Map<String, ?>> generatePrimitiveTypes(Set<String> primitiveTypes) { final List<Map<String, ?>> list = new ArrayList<>(); if (!primitiveTypes.isEmpty()) { list.add(pattern(it -> { it.matches(keywordRegex(primitiveTypes) + "(?:\\s*\\[\\s*\\])*"); //$NON-NLS-1$ it.style(PRIMITIVE_TYPE_STYLE); it.comment("Primitive types"); //$NON-NLS-1$ })); } return list; }
java
protected List<Map<String, ?>> generatePrimitiveTypes(Set<String> primitiveTypes) { final List<Map<String, ?>> list = new ArrayList<>(); if (!primitiveTypes.isEmpty()) { list.add(pattern(it -> { it.matches(keywordRegex(primitiveTypes) + "(?:\\s*\\[\\s*\\])*"); //$NON-NLS-1$ it.style(PRIMITIVE_TYPE_STYLE); it.comment("Primitive types"); //$NON-NLS-1$ })); } return list; }
[ "protected", "List", "<", "Map", "<", "String", ",", "?", ">", ">", "generatePrimitiveTypes", "(", "Set", "<", "String", ">", "primitiveTypes", ")", "{", "final", "List", "<", "Map", "<", "String", ",", "?", ">", ">", "list", "=", "new", "ArrayList", ...
Generate the rules for the primitive types. @param primitiveTypes the primitive types. @return the rules.
[ "Generate", "the", "rules", "for", "the", "primitive", "types", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/textmate/TextMateGenerator2.java#L383-L393
train
sarl/sarl
main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/textmate/TextMateGenerator2.java
TextMateGenerator2.generateLiterals
protected List<Map<String, ?>> generateLiterals(Set<String> literals) { final List<Map<String, ?>> list = new ArrayList<>(); if (!literals.isEmpty()) { list.add(pattern(it -> { it.matches(keywordRegex(literals)); it.style(LITERAL_STYLE); it.comment("SARL Literals and Constants"); //$NON-NLS-1$ })); } return list; }
java
protected List<Map<String, ?>> generateLiterals(Set<String> literals) { final List<Map<String, ?>> list = new ArrayList<>(); if (!literals.isEmpty()) { list.add(pattern(it -> { it.matches(keywordRegex(literals)); it.style(LITERAL_STYLE); it.comment("SARL Literals and Constants"); //$NON-NLS-1$ })); } return list; }
[ "protected", "List", "<", "Map", "<", "String", ",", "?", ">", ">", "generateLiterals", "(", "Set", "<", "String", ">", "literals", ")", "{", "final", "List", "<", "Map", "<", "String", ",", "?", ">", ">", "list", "=", "new", "ArrayList", "<>", "("...
Generate the rules for the literals. @param literals the literals. @return the rules.
[ "Generate", "the", "rules", "for", "the", "literals", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/textmate/TextMateGenerator2.java#L400-L410
train
sarl/sarl
main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/textmate/TextMateGenerator2.java
TextMateGenerator2.generatePunctuation
protected List<Map<String, ?>> generatePunctuation(Set<String> punctuation) { final List<Map<String, ?>> list = new ArrayList<>(); if (!punctuation.isEmpty()) { list.add(pattern(it -> { it.matches(orRegex(punctuation)); it.style(PUNCTUATION_STYLE); it.comment("Operators and Punctuations"); //$NON-NLS-1$ })); } return list; }
java
protected List<Map<String, ?>> generatePunctuation(Set<String> punctuation) { final List<Map<String, ?>> list = new ArrayList<>(); if (!punctuation.isEmpty()) { list.add(pattern(it -> { it.matches(orRegex(punctuation)); it.style(PUNCTUATION_STYLE); it.comment("Operators and Punctuations"); //$NON-NLS-1$ })); } return list; }
[ "protected", "List", "<", "Map", "<", "String", ",", "?", ">", ">", "generatePunctuation", "(", "Set", "<", "String", ">", "punctuation", ")", "{", "final", "List", "<", "Map", "<", "String", ",", "?", ">", ">", "list", "=", "new", "ArrayList", "<>",...
Generate the rules for the punctuation symbols. @param punctuation the punctuation symbols. @return the rules.
[ "Generate", "the", "rules", "for", "the", "punctuation", "symbols", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/textmate/TextMateGenerator2.java#L417-L427
train
sarl/sarl
main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/textmate/TextMateGenerator2.java
TextMateGenerator2.generateModifiers
protected List<Map<String, ?>> generateModifiers(Set<String> modifiers) { final List<Map<String, ?>> list = new ArrayList<>(); if (!modifiers.isEmpty()) { list.add(pattern(it -> { it.matches(keywordRegex(modifiers)); it.style(MODIFIER_STYLE); it.comment("Modifiers"); //$NON-NLS-1$ })); } return list; }
java
protected List<Map<String, ?>> generateModifiers(Set<String> modifiers) { final List<Map<String, ?>> list = new ArrayList<>(); if (!modifiers.isEmpty()) { list.add(pattern(it -> { it.matches(keywordRegex(modifiers)); it.style(MODIFIER_STYLE); it.comment("Modifiers"); //$NON-NLS-1$ })); } return list; }
[ "protected", "List", "<", "Map", "<", "String", ",", "?", ">", ">", "generateModifiers", "(", "Set", "<", "String", ">", "modifiers", ")", "{", "final", "List", "<", "Map", "<", "String", ",", "?", ">", ">", "list", "=", "new", "ArrayList", "<>", "...
Generate the rules for the modifier keywords. @param modifiers the modifier keywords. @return the rules.
[ "Generate", "the", "rules", "for", "the", "modifier", "keywords", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/textmate/TextMateGenerator2.java#L434-L444
train
sarl/sarl
main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/textmate/TextMateGenerator2.java
TextMateGenerator2.generateSpecialKeywords
protected List<Map<String, ?>> generateSpecialKeywords(Set<String> keywords) { final List<Map<String, ?>> list = new ArrayList<>(); if (!keywords.isEmpty()) { list.add(pattern(it -> { it.matches(keywordRegex(keywords)); it.style(SPECIAL_KEYWORD_STYLE); it.comment("Special Keywords"); //$NON-NLS-1$ })); } return list; }
java
protected List<Map<String, ?>> generateSpecialKeywords(Set<String> keywords) { final List<Map<String, ?>> list = new ArrayList<>(); if (!keywords.isEmpty()) { list.add(pattern(it -> { it.matches(keywordRegex(keywords)); it.style(SPECIAL_KEYWORD_STYLE); it.comment("Special Keywords"); //$NON-NLS-1$ })); } return list; }
[ "protected", "List", "<", "Map", "<", "String", ",", "?", ">", ">", "generateSpecialKeywords", "(", "Set", "<", "String", ">", "keywords", ")", "{", "final", "List", "<", "Map", "<", "String", ",", "?", ">", ">", "list", "=", "new", "ArrayList", "<>"...
Generate the rules for the special keywords. @param keywords the special keywords. @return the rules.
[ "Generate", "the", "rules", "for", "the", "special", "keywords", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/textmate/TextMateGenerator2.java#L451-L461
train
sarl/sarl
main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/textmate/TextMateGenerator2.java
TextMateGenerator2.generateStandardKeywords
protected List<Map<String, ?>> generateStandardKeywords(Set<String> keywords) { final List<Map<String, ?>> list = new ArrayList<>(); if (!keywords.isEmpty()) { list.add(pattern(it -> { it.matches(keywordRegex(keywords)); it.style(KEYWORD_STYLE); it.comment("Standard Keywords"); //$NON-NLS-1$ })); } return list; }
java
protected List<Map<String, ?>> generateStandardKeywords(Set<String> keywords) { final List<Map<String, ?>> list = new ArrayList<>(); if (!keywords.isEmpty()) { list.add(pattern(it -> { it.matches(keywordRegex(keywords)); it.style(KEYWORD_STYLE); it.comment("Standard Keywords"); //$NON-NLS-1$ })); } return list; }
[ "protected", "List", "<", "Map", "<", "String", ",", "?", ">", ">", "generateStandardKeywords", "(", "Set", "<", "String", ">", "keywords", ")", "{", "final", "List", "<", "Map", "<", "String", ",", "?", ">", ">", "list", "=", "new", "ArrayList", "<>...
Generate the rules for the standard keywords. @param keywords the standard keywords. @return the rules.
[ "Generate", "the", "rules", "for", "the", "standard", "keywords", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/textmate/TextMateGenerator2.java#L468-L478
train
sarl/sarl
main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/textmate/TextMateGenerator2.java
TextMateGenerator2.generateTypeDeclarations
protected List<Map<String, ?>> generateTypeDeclarations(Set<String> declarators) { final List<Map<String, ?>> list = new ArrayList<>(); if (!declarators.isEmpty()) { list.add(pattern(it -> { it.matches(keywordRegex(declarators)); it.style(TYPE_DECLARATION_STYLE); it.comment("Type Declarations"); //$NON-NLS-1$ })); } return list; }
java
protected List<Map<String, ?>> generateTypeDeclarations(Set<String> declarators) { final List<Map<String, ?>> list = new ArrayList<>(); if (!declarators.isEmpty()) { list.add(pattern(it -> { it.matches(keywordRegex(declarators)); it.style(TYPE_DECLARATION_STYLE); it.comment("Type Declarations"); //$NON-NLS-1$ })); } return list; }
[ "protected", "List", "<", "Map", "<", "String", ",", "?", ">", ">", "generateTypeDeclarations", "(", "Set", "<", "String", ">", "declarators", ")", "{", "final", "List", "<", "Map", "<", "String", ",", "?", ">", ">", "list", "=", "new", "ArrayList", ...
Generate the rules for the type declaration keywords. @param declarators the type declaration keywords. @return the rules.
[ "Generate", "the", "rules", "for", "the", "type", "declaration", "keywords", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/textmate/TextMateGenerator2.java#L485-L495
train
sarl/sarl
main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/textmate/TextMateGenerator2.java
TextMateGenerator2.pattern
protected Map<String, ?> pattern(Procedure1<? super Pattern> proc) { final Pattern patternDefinition = new Pattern(); proc.apply(patternDefinition); return patternDefinition.getDefinition(); }
java
protected Map<String, ?> pattern(Procedure1<? super Pattern> proc) { final Pattern patternDefinition = new Pattern(); proc.apply(patternDefinition); return patternDefinition.getDefinition(); }
[ "protected", "Map", "<", "String", ",", "?", ">", "pattern", "(", "Procedure1", "<", "?", "super", "Pattern", ">", "proc", ")", "{", "final", "Pattern", "patternDefinition", "=", "new", "Pattern", "(", ")", ";", "proc", ".", "apply", "(", "patternDefinit...
Build a pattern definition. @param proc the initializer. @return the definition.
[ "Build", "a", "pattern", "definition", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/textmate/TextMateGenerator2.java#L502-L506
train
sarl/sarl
products/sarlc/src/main/java/io/sarl/lang/sarlc/modules/commands/ExtraLanguageListCommandModule.java
ExtraLanguageListCommandModule.provideExtraLanguageListCommand
@SuppressWarnings("static-method") @Provides @Singleton public ExtraLanguageListCommand provideExtraLanguageListCommand(BootLogger bootLogger, Provider<IExtraLanguageContributions> contributions) { return new ExtraLanguageListCommand(bootLogger, contributions); }
java
@SuppressWarnings("static-method") @Provides @Singleton public ExtraLanguageListCommand provideExtraLanguageListCommand(BootLogger bootLogger, Provider<IExtraLanguageContributions> contributions) { return new ExtraLanguageListCommand(bootLogger, contributions); }
[ "@", "SuppressWarnings", "(", "\"static-method\"", ")", "@", "Provides", "@", "Singleton", "public", "ExtraLanguageListCommand", "provideExtraLanguageListCommand", "(", "BootLogger", "bootLogger", ",", "Provider", "<", "IExtraLanguageContributions", ">", "contributions", ")...
Provide the command for displaying the available extra-language generators. @param bootLogger the logger. @param contributions the provider of the extra-language contributions. @return the command.
[ "Provide", "the", "command", "for", "displaying", "the", "available", "extra", "-", "language", "generators", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/products/sarlc/src/main/java/io/sarl/lang/sarlc/modules/commands/ExtraLanguageListCommandModule.java#L56-L62
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/formatting2/SARLFormatter.java
SARLFormatter._format
protected void _format(SarlEvent event, IFormattableDocument document) { formatAnnotations(event, document, XbaseFormatterPreferenceKeys.newLineAfterClassAnnotations); formatModifiers(event, document); final ISemanticRegionsFinder regionFor = this.textRegionExtensions.regionFor(event); document.append(regionFor.keyword(this.keywords.getEventKeyword()), ONE_SPACE); document.surround(regionFor.keyword(this.keywords.getExtendsKeyword()), ONE_SPACE); document.format(event.getExtends()); formatBody(event, document); }
java
protected void _format(SarlEvent event, IFormattableDocument document) { formatAnnotations(event, document, XbaseFormatterPreferenceKeys.newLineAfterClassAnnotations); formatModifiers(event, document); final ISemanticRegionsFinder regionFor = this.textRegionExtensions.regionFor(event); document.append(regionFor.keyword(this.keywords.getEventKeyword()), ONE_SPACE); document.surround(regionFor.keyword(this.keywords.getExtendsKeyword()), ONE_SPACE); document.format(event.getExtends()); formatBody(event, document); }
[ "protected", "void", "_format", "(", "SarlEvent", "event", ",", "IFormattableDocument", "document", ")", "{", "formatAnnotations", "(", "event", ",", "document", ",", "XbaseFormatterPreferenceKeys", ".", "newLineAfterClassAnnotations", ")", ";", "formatModifiers", "(", ...
Format the given SARL event. @param event the SARL component. @param document the document.
[ "Format", "the", "given", "SARL", "event", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/formatting2/SARLFormatter.java#L195-L206
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/formatting2/SARLFormatter.java
SARLFormatter._format
protected void _format(SarlCapacity capacity, IFormattableDocument document) { formatAnnotations(capacity, document, XbaseFormatterPreferenceKeys.newLineAfterClassAnnotations); formatModifiers(capacity, document); final ISemanticRegionsFinder regionFor = this.textRegionExtensions.regionFor(capacity); document.append(regionFor.keyword(this.keywords.getCapacityKeyword()), ONE_SPACE); document.surround(regionFor.keyword(this.keywords.getExtendsKeyword()), ONE_SPACE); formatCommaSeparatedList(capacity.getExtends(), document); formatBody(capacity, document); }
java
protected void _format(SarlCapacity capacity, IFormattableDocument document) { formatAnnotations(capacity, document, XbaseFormatterPreferenceKeys.newLineAfterClassAnnotations); formatModifiers(capacity, document); final ISemanticRegionsFinder regionFor = this.textRegionExtensions.regionFor(capacity); document.append(regionFor.keyword(this.keywords.getCapacityKeyword()), ONE_SPACE); document.surround(regionFor.keyword(this.keywords.getExtendsKeyword()), ONE_SPACE); formatCommaSeparatedList(capacity.getExtends(), document); formatBody(capacity, document); }
[ "protected", "void", "_format", "(", "SarlCapacity", "capacity", ",", "IFormattableDocument", "document", ")", "{", "formatAnnotations", "(", "capacity", ",", "document", ",", "XbaseFormatterPreferenceKeys", ".", "newLineAfterClassAnnotations", ")", ";", "formatModifiers"...
Format the given SARL capacity. @param capacity the SARL component. @param document the document.
[ "Format", "the", "given", "SARL", "capacity", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/formatting2/SARLFormatter.java#L213-L225
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/formatting2/SARLFormatter.java
SARLFormatter._format
protected void _format(SarlAgent agent, IFormattableDocument document) { formatAnnotations(agent, document, XbaseFormatterPreferenceKeys.newLineAfterClassAnnotations); formatModifiers(agent, document); final ISemanticRegionsFinder regionFor = this.textRegionExtensions.regionFor(agent); document.append(regionFor.keyword(this.keywords.getAgentKeyword()), ONE_SPACE); document.surround(regionFor.keyword(this.keywords.getExtendsKeyword()), ONE_SPACE); document.format(agent.getExtends()); formatBody(agent, document); }
java
protected void _format(SarlAgent agent, IFormattableDocument document) { formatAnnotations(agent, document, XbaseFormatterPreferenceKeys.newLineAfterClassAnnotations); formatModifiers(agent, document); final ISemanticRegionsFinder regionFor = this.textRegionExtensions.regionFor(agent); document.append(regionFor.keyword(this.keywords.getAgentKeyword()), ONE_SPACE); document.surround(regionFor.keyword(this.keywords.getExtendsKeyword()), ONE_SPACE); document.format(agent.getExtends()); formatBody(agent, document); }
[ "protected", "void", "_format", "(", "SarlAgent", "agent", ",", "IFormattableDocument", "document", ")", "{", "formatAnnotations", "(", "agent", ",", "document", ",", "XbaseFormatterPreferenceKeys", ".", "newLineAfterClassAnnotations", ")", ";", "formatModifiers", "(", ...
Format the given SARL agent. @param agent the SARL component. @param document the document.
[ "Format", "the", "given", "SARL", "agent", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/formatting2/SARLFormatter.java#L232-L243
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/formatting2/SARLFormatter.java
SARLFormatter._format
protected void _format(SarlBehavior behavior, IFormattableDocument document) { formatAnnotations(behavior, document, XbaseFormatterPreferenceKeys.newLineAfterClassAnnotations); formatModifiers(behavior, document); final ISemanticRegionsFinder regionFor = this.textRegionExtensions.regionFor(behavior); document.append(regionFor.keyword(this.keywords.getBehaviorKeyword()), ONE_SPACE); document.surround(regionFor.keyword(this.keywords.getExtendsKeyword()), ONE_SPACE); document.format(behavior.getExtends()); formatBody(behavior, document); }
java
protected void _format(SarlBehavior behavior, IFormattableDocument document) { formatAnnotations(behavior, document, XbaseFormatterPreferenceKeys.newLineAfterClassAnnotations); formatModifiers(behavior, document); final ISemanticRegionsFinder regionFor = this.textRegionExtensions.regionFor(behavior); document.append(regionFor.keyword(this.keywords.getBehaviorKeyword()), ONE_SPACE); document.surround(regionFor.keyword(this.keywords.getExtendsKeyword()), ONE_SPACE); document.format(behavior.getExtends()); formatBody(behavior, document); }
[ "protected", "void", "_format", "(", "SarlBehavior", "behavior", ",", "IFormattableDocument", "document", ")", "{", "formatAnnotations", "(", "behavior", ",", "document", ",", "XbaseFormatterPreferenceKeys", ".", "newLineAfterClassAnnotations", ")", ";", "formatModifiers"...
Format the given SARL behavior. @param behavior the SARL component. @param document the document.
[ "Format", "the", "given", "SARL", "behavior", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/formatting2/SARLFormatter.java#L250-L261
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/formatting2/SARLFormatter.java
SARLFormatter._format
protected void _format(SarlSkill skill, IFormattableDocument document) { formatAnnotations(skill, document, XbaseFormatterPreferenceKeys.newLineAfterClassAnnotations); formatModifiers(skill, document); final ISemanticRegionsFinder regionFor = this.textRegionExtensions.regionFor(skill); document.append(regionFor.keyword(this.keywords.getSkillKeyword()), ONE_SPACE); document.surround(regionFor.keyword(this.keywords.getExtendsKeyword()), ONE_SPACE); document.format(skill.getExtends()); document.surround(regionFor.keyword(this.keywords.getImplementsKeyword()), ONE_SPACE); formatCommaSeparatedList(skill.getImplements(), document); formatBody(skill, document); }
java
protected void _format(SarlSkill skill, IFormattableDocument document) { formatAnnotations(skill, document, XbaseFormatterPreferenceKeys.newLineAfterClassAnnotations); formatModifiers(skill, document); final ISemanticRegionsFinder regionFor = this.textRegionExtensions.regionFor(skill); document.append(regionFor.keyword(this.keywords.getSkillKeyword()), ONE_SPACE); document.surround(regionFor.keyword(this.keywords.getExtendsKeyword()), ONE_SPACE); document.format(skill.getExtends()); document.surround(regionFor.keyword(this.keywords.getImplementsKeyword()), ONE_SPACE); formatCommaSeparatedList(skill.getImplements(), document); formatBody(skill, document); }
[ "protected", "void", "_format", "(", "SarlSkill", "skill", ",", "IFormattableDocument", "document", ")", "{", "formatAnnotations", "(", "skill", ",", "document", ",", "XbaseFormatterPreferenceKeys", ".", "newLineAfterClassAnnotations", ")", ";", "formatModifiers", "(", ...
Format the given SARL skill. @param skill the SARL component. @param document the document.
[ "Format", "the", "given", "SARL", "skill", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/formatting2/SARLFormatter.java#L268-L282
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/formatting2/SARLFormatter.java
SARLFormatter._format
protected void _format(SarlBehaviorUnit behaviorUnit, IFormattableDocument document) { formatAnnotations(behaviorUnit, document, XbaseFormatterPreferenceKeys.newLineAfterMethodAnnotations); final ISemanticRegionsFinder regionFor = this.textRegionExtensions.regionFor(behaviorUnit); document.append(regionFor.keyword(this.keywords.getOnKeyword()), ONE_SPACE); if (behaviorUnit.getGuard() != null) { ISemanticRegion keyword = this.textRegionExtensions.immediatelyPreceding( behaviorUnit.getGuard()).keyword(this.keywords.getLeftSquareBracketKeyword()); document.prepend(keyword, ONE_SPACE); document.append(keyword, NO_SPACE); keyword = this.textRegionExtensions.immediatelyFollowing( behaviorUnit.getGuard()).keyword(this.keywords.getRightSquareBracketKeyword()); document.prepend(keyword, NO_SPACE); } document.format(behaviorUnit.getName()); document.format(behaviorUnit.getGuard()); final XExpression expression = behaviorUnit.getExpression(); if (expression != null) { final ISemanticRegionFinder finder = this.textRegionExtensions.regionFor(expression); final ISemanticRegion brace = finder.keyword(this.keywords.getLeftCurlyBracketKeyword()); document.prepend(brace, XbaseFormatterPreferenceKeys.bracesInNewLine); document.format(expression); } }
java
protected void _format(SarlBehaviorUnit behaviorUnit, IFormattableDocument document) { formatAnnotations(behaviorUnit, document, XbaseFormatterPreferenceKeys.newLineAfterMethodAnnotations); final ISemanticRegionsFinder regionFor = this.textRegionExtensions.regionFor(behaviorUnit); document.append(regionFor.keyword(this.keywords.getOnKeyword()), ONE_SPACE); if (behaviorUnit.getGuard() != null) { ISemanticRegion keyword = this.textRegionExtensions.immediatelyPreceding( behaviorUnit.getGuard()).keyword(this.keywords.getLeftSquareBracketKeyword()); document.prepend(keyword, ONE_SPACE); document.append(keyword, NO_SPACE); keyword = this.textRegionExtensions.immediatelyFollowing( behaviorUnit.getGuard()).keyword(this.keywords.getRightSquareBracketKeyword()); document.prepend(keyword, NO_SPACE); } document.format(behaviorUnit.getName()); document.format(behaviorUnit.getGuard()); final XExpression expression = behaviorUnit.getExpression(); if (expression != null) { final ISemanticRegionFinder finder = this.textRegionExtensions.regionFor(expression); final ISemanticRegion brace = finder.keyword(this.keywords.getLeftCurlyBracketKeyword()); document.prepend(brace, XbaseFormatterPreferenceKeys.bracesInNewLine); document.format(expression); } }
[ "protected", "void", "_format", "(", "SarlBehaviorUnit", "behaviorUnit", ",", "IFormattableDocument", "document", ")", "{", "formatAnnotations", "(", "behaviorUnit", ",", "document", ",", "XbaseFormatterPreferenceKeys", ".", "newLineAfterMethodAnnotations", ")", ";", "fin...
Format a behavior unit. @param behaviorUnit the behavior unit. @param document the document.
[ "Format", "a", "behavior", "unit", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/formatting2/SARLFormatter.java#L441-L468
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/formatting2/SARLFormatter.java
SARLFormatter._format
protected void _format(SarlCapacityUses capacityUses, IFormattableDocument document) { final ISemanticRegionsFinder regionFor = this.textRegionExtensions.regionFor(capacityUses); document.append(regionFor.keyword(this.keywords.getUsesKeyword()), ONE_SPACE); formatCommaSeparatedList(capacityUses.getCapacities(), document); document.prepend(regionFor.keyword(this.keywords.getSemicolonKeyword()), NO_SPACE); }
java
protected void _format(SarlCapacityUses capacityUses, IFormattableDocument document) { final ISemanticRegionsFinder regionFor = this.textRegionExtensions.regionFor(capacityUses); document.append(regionFor.keyword(this.keywords.getUsesKeyword()), ONE_SPACE); formatCommaSeparatedList(capacityUses.getCapacities(), document); document.prepend(regionFor.keyword(this.keywords.getSemicolonKeyword()), NO_SPACE); }
[ "protected", "void", "_format", "(", "SarlCapacityUses", "capacityUses", ",", "IFormattableDocument", "document", ")", "{", "final", "ISemanticRegionsFinder", "regionFor", "=", "this", ".", "textRegionExtensions", ".", "regionFor", "(", "capacityUses", ")", ";", "docu...
Format a capacity use. @param capacityUses the capacity uses. @param document the document.
[ "Format", "a", "capacity", "use", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/formatting2/SARLFormatter.java#L475-L480
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/formatting2/SARLFormatter.java
SARLFormatter._format
protected void _format(SarlRequiredCapacity requiredCapacity, IFormattableDocument document) { final ISemanticRegionsFinder regionFor = this.textRegionExtensions.regionFor(requiredCapacity); document.append(regionFor.keyword(this.keywords.getRequiresKeyword()), ONE_SPACE); formatCommaSeparatedList(requiredCapacity.getCapacities(), document); document.prepend(regionFor.keyword(this.keywords.getSemicolonKeyword()), NO_SPACE); }
java
protected void _format(SarlRequiredCapacity requiredCapacity, IFormattableDocument document) { final ISemanticRegionsFinder regionFor = this.textRegionExtensions.regionFor(requiredCapacity); document.append(regionFor.keyword(this.keywords.getRequiresKeyword()), ONE_SPACE); formatCommaSeparatedList(requiredCapacity.getCapacities(), document); document.prepend(regionFor.keyword(this.keywords.getSemicolonKeyword()), NO_SPACE); }
[ "protected", "void", "_format", "(", "SarlRequiredCapacity", "requiredCapacity", ",", "IFormattableDocument", "document", ")", "{", "final", "ISemanticRegionsFinder", "regionFor", "=", "this", ".", "textRegionExtensions", ".", "regionFor", "(", "requiredCapacity", ")", ...
Format a required capacity. @param requiredCapacity the element ot format. @param document the document.
[ "Format", "a", "required", "capacity", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/formatting2/SARLFormatter.java#L487-L492
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/formatting2/SARLFormatter.java
SARLFormatter.formatCommaSeparatedList
protected void formatCommaSeparatedList(Collection<? extends EObject> elements, IFormattableDocument document) { for (final EObject element : elements) { document.format(element); final ISemanticRegionFinder immediatelyFollowing = this.textRegionExtensions.immediatelyFollowing(element); final ISemanticRegion keyword = immediatelyFollowing.keyword(this.keywords.getCommaKeyword()); document.prepend(keyword, NO_SPACE); document.append(keyword, ONE_SPACE); } }
java
protected void formatCommaSeparatedList(Collection<? extends EObject> elements, IFormattableDocument document) { for (final EObject element : elements) { document.format(element); final ISemanticRegionFinder immediatelyFollowing = this.textRegionExtensions.immediatelyFollowing(element); final ISemanticRegion keyword = immediatelyFollowing.keyword(this.keywords.getCommaKeyword()); document.prepend(keyword, NO_SPACE); document.append(keyword, ONE_SPACE); } }
[ "protected", "void", "formatCommaSeparatedList", "(", "Collection", "<", "?", "extends", "EObject", ">", "elements", ",", "IFormattableDocument", "document", ")", "{", "for", "(", "final", "EObject", "element", ":", "elements", ")", "{", "document", ".", "format...
Format a list of comma separated elements. <p>This function does not considerer opening and closing delimiters, as {@link #formatCommaSeparatedList(Collection, ISemanticRegion, ISemanticRegion, IFormattableDocument)}. @param elements the elements to format. @param document the document.
[ "Format", "a", "list", "of", "comma", "separated", "elements", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/formatting2/SARLFormatter.java#L594-L602
train
sarl/sarl
main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/validation/SARLUIStrings.java
SARLUIStrings.styledParameters
public StyledString styledParameters(JvmIdentifiableElement element) { final StyledString str = new StyledString(); if (element instanceof JvmExecutable) { final JvmExecutable executable = (JvmExecutable) element; str.append(this.keywords.getLeftParenthesisKeyword()); str.append(parametersToStyledString( executable.getParameters(), executable.isVarArgs(), false)); str.append(this.keywords.getRightParenthesisKeyword()); } return str; }
java
public StyledString styledParameters(JvmIdentifiableElement element) { final StyledString str = new StyledString(); if (element instanceof JvmExecutable) { final JvmExecutable executable = (JvmExecutable) element; str.append(this.keywords.getLeftParenthesisKeyword()); str.append(parametersToStyledString( executable.getParameters(), executable.isVarArgs(), false)); str.append(this.keywords.getRightParenthesisKeyword()); } return str; }
[ "public", "StyledString", "styledParameters", "(", "JvmIdentifiableElement", "element", ")", "{", "final", "StyledString", "str", "=", "new", "StyledString", "(", ")", ";", "if", "(", "element", "instanceof", "JvmExecutable", ")", "{", "final", "JvmExecutable", "e...
Replies the styled parameters. @param element the element from which the parameters are extracted. @return the styled parameters @since 0.6
[ "Replies", "the", "styled", "parameters", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/validation/SARLUIStrings.java#L86-L98
train
sarl/sarl
main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/validation/SARLUIStrings.java
SARLUIStrings.parametersToStyledString
protected StyledString parametersToStyledString(Iterable<? extends JvmFormalParameter> elements, boolean isVarArgs, boolean includeName) { return getParameterStyledString(elements, isVarArgs, includeName, this.keywords, this.annotationFinder, this); }
java
protected StyledString parametersToStyledString(Iterable<? extends JvmFormalParameter> elements, boolean isVarArgs, boolean includeName) { return getParameterStyledString(elements, isVarArgs, includeName, this.keywords, this.annotationFinder, this); }
[ "protected", "StyledString", "parametersToStyledString", "(", "Iterable", "<", "?", "extends", "JvmFormalParameter", ">", "elements", ",", "boolean", "isVarArgs", ",", "boolean", "includeName", ")", "{", "return", "getParameterStyledString", "(", "elements", ",", "isV...
Replies the styled string representation of the parameters. @param elements the parameters. @param isVarArgs indicates if the last parameter is variadic. @param includeName indicates if the names are included. @return the styled string. @since 0.6
[ "Replies", "the", "styled", "string", "representation", "of", "the", "parameters", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/validation/SARLUIStrings.java#L113-L115
train
sarl/sarl
main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/validation/SARLUIStrings.java
SARLUIStrings.getParameterString
public static String getParameterString(Iterable<? extends JvmFormalParameter> elements, boolean isVarArgs, boolean includeName, SARLGrammarKeywordAccess keywords, AnnotationLookup annotationFinder, UIStrings utils) { final StringBuilder result = new StringBuilder(); boolean needsSeparator = false; final Iterator<? extends JvmFormalParameter> iterator = elements.iterator(); while (iterator.hasNext()) { final JvmFormalParameter parameter = iterator.next(); if (needsSeparator) { result.append(keywords.getCommaKeyword()).append(" "); //$NON-NLS-1$ } needsSeparator = true; final boolean isDefaultValued = annotationFinder.findAnnotation(parameter, DefaultValue.class) != null; if (isDefaultValued) { result.append(keywords.getLeftSquareBracketKeyword()); } if (includeName) { result.append(parameter.getName()).append(" "); //$NON-NLS-1$ result.append(keywords.getColonKeyword()).append(" "); //$NON-NLS-1$ } JvmTypeReference typeRef = parameter.getParameterType(); if (isVarArgs && !iterator.hasNext() && typeRef instanceof JvmGenericArrayTypeReference) { typeRef = ((JvmGenericArrayTypeReference) typeRef).getComponentType(); result.append(utils.referenceToString(typeRef, NULL_TYPE)); result.append(keywords.getWildcardAsteriskKeyword()); } else { result.append(utils.referenceToString(typeRef, NULL_TYPE)); } if (isDefaultValued) { result.append(keywords.getRightSquareBracketKeyword()); } } return result.toString(); }
java
public static String getParameterString(Iterable<? extends JvmFormalParameter> elements, boolean isVarArgs, boolean includeName, SARLGrammarKeywordAccess keywords, AnnotationLookup annotationFinder, UIStrings utils) { final StringBuilder result = new StringBuilder(); boolean needsSeparator = false; final Iterator<? extends JvmFormalParameter> iterator = elements.iterator(); while (iterator.hasNext()) { final JvmFormalParameter parameter = iterator.next(); if (needsSeparator) { result.append(keywords.getCommaKeyword()).append(" "); //$NON-NLS-1$ } needsSeparator = true; final boolean isDefaultValued = annotationFinder.findAnnotation(parameter, DefaultValue.class) != null; if (isDefaultValued) { result.append(keywords.getLeftSquareBracketKeyword()); } if (includeName) { result.append(parameter.getName()).append(" "); //$NON-NLS-1$ result.append(keywords.getColonKeyword()).append(" "); //$NON-NLS-1$ } JvmTypeReference typeRef = parameter.getParameterType(); if (isVarArgs && !iterator.hasNext() && typeRef instanceof JvmGenericArrayTypeReference) { typeRef = ((JvmGenericArrayTypeReference) typeRef).getComponentType(); result.append(utils.referenceToString(typeRef, NULL_TYPE)); result.append(keywords.getWildcardAsteriskKeyword()); } else { result.append(utils.referenceToString(typeRef, NULL_TYPE)); } if (isDefaultValued) { result.append(keywords.getRightSquareBracketKeyword()); } } return result.toString(); }
[ "public", "static", "String", "getParameterString", "(", "Iterable", "<", "?", "extends", "JvmFormalParameter", ">", "elements", ",", "boolean", "isVarArgs", ",", "boolean", "includeName", ",", "SARLGrammarKeywordAccess", "keywords", ",", "AnnotationLookup", "annotation...
Format the parameters. @param elements the list of the formal parameters. @param isVarArgs indicates if the function has var args. @param includeName indicates if the names are included in the replied valued. @param keywords the keyword provider. @param annotationFinder the finder of attached annotations. @param utils the utility. @return the string representation of the parameters.
[ "Format", "the", "parameters", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/validation/SARLUIStrings.java#L127-L159
train
sarl/sarl
main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/explorer/SARLElementImageProvider.java
SARLElementImageProvider.setFileExtensions
@Inject public void setFileExtensions(@Named(Constants.FILE_EXTENSIONS) String fileExtensions) { this.fileExtensions.clear(); this.fileExtensions.addAll(Arrays.asList(fileExtensions.split("[,;: ]+"))); //$NON-NLS-1$ }
java
@Inject public void setFileExtensions(@Named(Constants.FILE_EXTENSIONS) String fileExtensions) { this.fileExtensions.clear(); this.fileExtensions.addAll(Arrays.asList(fileExtensions.split("[,;: ]+"))); //$NON-NLS-1$ }
[ "@", "Inject", "public", "void", "setFileExtensions", "(", "@", "Named", "(", "Constants", ".", "FILE_EXTENSIONS", ")", "String", "fileExtensions", ")", "{", "this", ".", "fileExtensions", ".", "clear", "(", ")", ";", "this", ".", "fileExtensions", ".", "add...
Set the file extensions. @param fileExtensions the file extensions.
[ "Set", "the", "file", "extensions", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/explorer/SARLElementImageProvider.java#L63-L67
train
sarl/sarl
main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/explorer/SARLElementImageProvider.java
SARLElementImageProvider.getPackageFragmentIcon
@SuppressWarnings("checkstyle:all") private ImageDescriptor getPackageFragmentIcon(IPackageFragment fragment) { boolean containsJavaElements = false; try { containsJavaElements = fragment.hasChildren(); } catch (JavaModelException e) { // assuming no children; } try { if (!containsJavaElements) { final Object[] resources = fragment.getNonJavaResources(); if (resources.length > 0) { for (final Object child : resources) { if (isSarlResource(child)) { return JavaPluginImages.DESC_OBJS_PACKAGE; } } return JavaPluginImages.DESC_OBJS_EMPTY_PACKAGE_RESOURCES; } } } catch (JavaModelException exception) { // } if (!containsJavaElements) { return JavaPluginImages.DESC_OBJS_EMPTY_PACKAGE; } return JavaPluginImages.DESC_OBJS_PACKAGE; }
java
@SuppressWarnings("checkstyle:all") private ImageDescriptor getPackageFragmentIcon(IPackageFragment fragment) { boolean containsJavaElements = false; try { containsJavaElements = fragment.hasChildren(); } catch (JavaModelException e) { // assuming no children; } try { if (!containsJavaElements) { final Object[] resources = fragment.getNonJavaResources(); if (resources.length > 0) { for (final Object child : resources) { if (isSarlResource(child)) { return JavaPluginImages.DESC_OBJS_PACKAGE; } } return JavaPluginImages.DESC_OBJS_EMPTY_PACKAGE_RESOURCES; } } } catch (JavaModelException exception) { // } if (!containsJavaElements) { return JavaPluginImages.DESC_OBJS_EMPTY_PACKAGE; } return JavaPluginImages.DESC_OBJS_PACKAGE; }
[ "@", "SuppressWarnings", "(", "\"checkstyle:all\"", ")", "private", "ImageDescriptor", "getPackageFragmentIcon", "(", "IPackageFragment", "fragment", ")", "{", "boolean", "containsJavaElements", "=", "false", ";", "try", "{", "containsJavaElements", "=", "fragment", "."...
Replies the image description of the package fragment. @param fragment the element. @return the descriptor.
[ "Replies", "the", "image", "description", "of", "the", "package", "fragment", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/explorer/SARLElementImageProvider.java#L93-L120
train
sarl/sarl
main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/explorer/SARLElementImageProvider.java
SARLElementImageProvider.isSarlResource
protected boolean isSarlResource(Object resource) { if (resource instanceof IFile) { final IFile file = (IFile) resource; return getFileExtensions().contains(file.getFileExtension()); } return false; }
java
protected boolean isSarlResource(Object resource) { if (resource instanceof IFile) { final IFile file = (IFile) resource; return getFileExtensions().contains(file.getFileExtension()); } return false; }
[ "protected", "boolean", "isSarlResource", "(", "Object", "resource", ")", "{", "if", "(", "resource", "instanceof", "IFile", ")", "{", "final", "IFile", "file", "=", "(", "IFile", ")", "resource", ";", "return", "getFileExtensions", "(", ")", ".", "contains"...
Replies if the given resource is a SARL resource. @param resource the resource. @return {@code true} if the given resource is a SARL resource.
[ "Replies", "if", "the", "given", "resource", "is", "a", "SARL", "resource", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/explorer/SARLElementImageProvider.java#L127-L133
train
sarl/sarl
main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/StandardSREInstall.java
StandardSREInstall.setJarFile
public void setJarFile(IPath jarFile) { if (!Objects.equal(jarFile, this.jarFile)) { final PropertyChangeEvent event = new PropertyChangeEvent(this, ISREInstallChangedListener.PROPERTY_JAR_FILE, this.jarFile, jarFile); this.jarFile = jarFile; setDirty(true); if (getNotify()) { SARLRuntime.fireSREChanged(event); } } }
java
public void setJarFile(IPath jarFile) { if (!Objects.equal(jarFile, this.jarFile)) { final PropertyChangeEvent event = new PropertyChangeEvent(this, ISREInstallChangedListener.PROPERTY_JAR_FILE, this.jarFile, jarFile); this.jarFile = jarFile; setDirty(true); if (getNotify()) { SARLRuntime.fireSREChanged(event); } } }
[ "public", "void", "setJarFile", "(", "IPath", "jarFile", ")", "{", "if", "(", "!", "Objects", ".", "equal", "(", "jarFile", ",", "this", ".", "jarFile", ")", ")", "{", "final", "PropertyChangeEvent", "event", "=", "new", "PropertyChangeEvent", "(", "this",...
Change the path to the JAR file that is supporting this SRE installation. @param jarFile the path to the JAR file. Must not be <code>null</code>.
[ "Change", "the", "path", "to", "the", "JAR", "file", "that", "is", "supporting", "this", "SRE", "installation", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/StandardSREInstall.java#L167-L177
train
sarl/sarl
main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/StandardSREInstall.java
StandardSREInstall.parsePath
private static IPath parsePath(String path, IPath defaultPath, IPath rootPath) { if (!Strings.isNullOrEmpty(path)) { try { final IPath pathObject = Path.fromPortableString(path); if (pathObject != null) { if (rootPath != null && !pathObject.isAbsolute()) { return rootPath.append(pathObject); } return pathObject; } } catch (Throwable exception) { // } } return defaultPath; }
java
private static IPath parsePath(String path, IPath defaultPath, IPath rootPath) { if (!Strings.isNullOrEmpty(path)) { try { final IPath pathObject = Path.fromPortableString(path); if (pathObject != null) { if (rootPath != null && !pathObject.isAbsolute()) { return rootPath.append(pathObject); } return pathObject; } } catch (Throwable exception) { // } } return defaultPath; }
[ "private", "static", "IPath", "parsePath", "(", "String", "path", ",", "IPath", "defaultPath", ",", "IPath", "rootPath", ")", "{", "if", "(", "!", "Strings", ".", "isNullOrEmpty", "(", "path", ")", ")", "{", "try", "{", "final", "IPath", "pathObject", "=...
Path the given string for extracting a path. @param path the string representation of the path to parse. @param defaultPath the default path. @param rootPath the root path to use is the given path is not absolute. @return the absolute path.
[ "Path", "the", "given", "string", "for", "extracting", "a", "path", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/runtime/StandardSREInstall.java#L515-L530
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/extralanguage/compiler/AbstractExtraLanguageGenerator.java
AbstractExtraLanguageGenerator.loadPropertyFile
public static List<Pair<String, String>> loadPropertyFile(String filename, Plugin bundledPlugin, Class<?> readerClass, Function1<IOException, IStatus> statusBuilder) { final URL url; if (bundledPlugin != null) { url = FileLocator.find( bundledPlugin.getBundle(), Path.fromPortableString(filename), null); } else { url = readerClass.getClassLoader().getResource(filename); } if (url == null) { return Lists.newArrayList(); } final OrderedProperties properties = new OrderedProperties(); try (InputStream is = url.openStream()) { properties.load(is); } catch (IOException exception) { if (bundledPlugin != null) { bundledPlugin.getLog().log(statusBuilder.apply(exception)); } else { throw new RuntimeException(exception); } } return properties.getOrderedProperties(); }
java
public static List<Pair<String, String>> loadPropertyFile(String filename, Plugin bundledPlugin, Class<?> readerClass, Function1<IOException, IStatus> statusBuilder) { final URL url; if (bundledPlugin != null) { url = FileLocator.find( bundledPlugin.getBundle(), Path.fromPortableString(filename), null); } else { url = readerClass.getClassLoader().getResource(filename); } if (url == null) { return Lists.newArrayList(); } final OrderedProperties properties = new OrderedProperties(); try (InputStream is = url.openStream()) { properties.load(is); } catch (IOException exception) { if (bundledPlugin != null) { bundledPlugin.getLog().log(statusBuilder.apply(exception)); } else { throw new RuntimeException(exception); } } return properties.getOrderedProperties(); }
[ "public", "static", "List", "<", "Pair", "<", "String", ",", "String", ">", ">", "loadPropertyFile", "(", "String", "filename", ",", "Plugin", "bundledPlugin", ",", "Class", "<", "?", ">", "readerClass", ",", "Function1", "<", "IOException", ",", "IStatus", ...
Load a property file from the resources. This function is able to get the resource from an OSGi bundles if it is specified, or from the application classpath. @param filename the name of the resource, without the starting slash character. @param bundledPlugin the plugin that is able to provide the bundle that contains the resources, or {@code null} to use the application classpath. @param readerClass the class that has called this function. It is used for obtaining the resource if the bundled plugin is not provided. @param statusBuilder the builder of a status that takes the exception as parameter and creates a status object. This builder is used only if the {@code bundledPlugin} is not {@code null}. @return the loaded resources.
[ "Load", "a", "property", "file", "from", "the", "resources", ".", "This", "function", "is", "able", "to", "get", "the", "resource", "from", "an", "OSGi", "bundles", "if", "it", "is", "specified", "or", "from", "the", "application", "classpath", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/extralanguage/compiler/AbstractExtraLanguageGenerator.java#L169-L195
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/extralanguage/compiler/AbstractExtraLanguageGenerator.java
AbstractExtraLanguageGenerator.getAssociatedExpression
protected XExpression getAssociatedExpression(JvmMember object) { final XExpression expr = getTypeBuilder().getExpression(object); if (expr == null) { // The member may be a automatically generated code with dynamic code-building strategies final Procedure1<? super ITreeAppendable> strategy = getTypeExtensions().getCompilationStrategy(object); if (strategy != null) { // } else { final StringConcatenationClient template = getTypeExtensions().getCompilationTemplate(object); if (template != null) { // } } } return expr; }
java
protected XExpression getAssociatedExpression(JvmMember object) { final XExpression expr = getTypeBuilder().getExpression(object); if (expr == null) { // The member may be a automatically generated code with dynamic code-building strategies final Procedure1<? super ITreeAppendable> strategy = getTypeExtensions().getCompilationStrategy(object); if (strategy != null) { // } else { final StringConcatenationClient template = getTypeExtensions().getCompilationTemplate(object); if (template != null) { // } } } return expr; }
[ "protected", "XExpression", "getAssociatedExpression", "(", "JvmMember", "object", ")", "{", "final", "XExpression", "expr", "=", "getTypeBuilder", "(", ")", ".", "getExpression", "(", "object", ")", ";", "if", "(", "expr", "==", "null", ")", "{", "// The memb...
Replies the expression associated to the given object. Usually, the expression is inside the given object. @param object the object. @return the expression, or {@code null} if none.
[ "Replies", "the", "expression", "associated", "to", "the", "given", "object", ".", "Usually", "the", "expression", "is", "inside", "the", "given", "object", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/extralanguage/compiler/AbstractExtraLanguageGenerator.java#L409-L424
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/extralanguage/compiler/AbstractExtraLanguageGenerator.java
AbstractExtraLanguageGenerator.toFilename
protected String toFilename(QualifiedName name, String separator) { final List<String> segments = name.getSegments(); if (segments.isEmpty()) { return ""; //$NON-NLS-1$ } final StringBuilder builder = new StringBuilder(); builder.append(name.toString(separator)); builder.append(getFilenameExtension()); return builder.toString(); }
java
protected String toFilename(QualifiedName name, String separator) { final List<String> segments = name.getSegments(); if (segments.isEmpty()) { return ""; //$NON-NLS-1$ } final StringBuilder builder = new StringBuilder(); builder.append(name.toString(separator)); builder.append(getFilenameExtension()); return builder.toString(); }
[ "protected", "String", "toFilename", "(", "QualifiedName", "name", ",", "String", "separator", ")", "{", "final", "List", "<", "String", ">", "segments", "=", "name", ".", "getSegments", "(", ")", ";", "if", "(", "segments", ".", "isEmpty", "(", ")", ")"...
Replies the filename for the qualified name. @param name the qualified name. @param separator the filename separator. @return the filename.
[ "Replies", "the", "filename", "for", "the", "qualified", "name", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/extralanguage/compiler/AbstractExtraLanguageGenerator.java#L438-L447
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/extralanguage/compiler/AbstractExtraLanguageGenerator.java
AbstractExtraLanguageGenerator.writeFile
protected boolean writeFile(QualifiedName name, ExtraLanguageAppendable appendable, IExtraLanguageGeneratorContext context) { final ExtraLanguageAppendable fileAppendable = createAppendable(null, context); generateFileHeader(name, fileAppendable, context); final ImportManager importManager = appendable.getImportManager(); if (importManager != null && !importManager.getImports().isEmpty()) { for (final String imported : importManager.getImports()) { final QualifiedName qn = getQualifiedNameConverter().toQualifiedName(imported); generateImportStatement(qn, fileAppendable, context); } fileAppendable.newLine(); } fileAppendable.append(appendable.getContent()); final String content = fileAppendable.getContent(); if (!Strings.isEmpty(content)) { final String fileName = toFilename(name, FILENAME_SEPARATOR); final String outputConfiguration = getOutputConfigurationName(); if (Strings.isEmpty(outputConfiguration)) { context.getFileSystemAccess().generateFile(fileName, content); } else { context.getFileSystemAccess().generateFile(fileName, outputConfiguration, content); } return true; } return false; }
java
protected boolean writeFile(QualifiedName name, ExtraLanguageAppendable appendable, IExtraLanguageGeneratorContext context) { final ExtraLanguageAppendable fileAppendable = createAppendable(null, context); generateFileHeader(name, fileAppendable, context); final ImportManager importManager = appendable.getImportManager(); if (importManager != null && !importManager.getImports().isEmpty()) { for (final String imported : importManager.getImports()) { final QualifiedName qn = getQualifiedNameConverter().toQualifiedName(imported); generateImportStatement(qn, fileAppendable, context); } fileAppendable.newLine(); } fileAppendable.append(appendable.getContent()); final String content = fileAppendable.getContent(); if (!Strings.isEmpty(content)) { final String fileName = toFilename(name, FILENAME_SEPARATOR); final String outputConfiguration = getOutputConfigurationName(); if (Strings.isEmpty(outputConfiguration)) { context.getFileSystemAccess().generateFile(fileName, content); } else { context.getFileSystemAccess().generateFile(fileName, outputConfiguration, content); } return true; } return false; }
[ "protected", "boolean", "writeFile", "(", "QualifiedName", "name", ",", "ExtraLanguageAppendable", "appendable", ",", "IExtraLanguageGeneratorContext", "context", ")", "{", "final", "ExtraLanguageAppendable", "fileAppendable", "=", "createAppendable", "(", "null", ",", "c...
Write the given file. @param name the name of the type to write. @param appendable the content to be written. @param context the generator context. @return {@code true} if the file was written.
[ "Write", "the", "given", "file", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/extralanguage/compiler/AbstractExtraLanguageGenerator.java#L477-L504
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/extralanguage/compiler/AbstractExtraLanguageGenerator.java
AbstractExtraLanguageGenerator.createGeneratorContext
protected IExtraLanguageGeneratorContext createGeneratorContext(IFileSystemAccess2 fsa, IGeneratorContext context, Resource resource) { if (context instanceof IExtraLanguageGeneratorContext) { return (IExtraLanguageGeneratorContext) context; } return new ExtraLanguageGeneratorContext(context, fsa, this, resource, getPreferenceID()); }
java
protected IExtraLanguageGeneratorContext createGeneratorContext(IFileSystemAccess2 fsa, IGeneratorContext context, Resource resource) { if (context instanceof IExtraLanguageGeneratorContext) { return (IExtraLanguageGeneratorContext) context; } return new ExtraLanguageGeneratorContext(context, fsa, this, resource, getPreferenceID()); }
[ "protected", "IExtraLanguageGeneratorContext", "createGeneratorContext", "(", "IFileSystemAccess2", "fsa", ",", "IGeneratorContext", "context", ",", "Resource", "resource", ")", "{", "if", "(", "context", "instanceof", "IExtraLanguageGeneratorContext", ")", "{", "return", ...
Create the generator context for this generator. @param fsa the file system access. @param context the global context. @param resource the resource. @return the context.
[ "Create", "the", "generator", "context", "for", "this", "generator", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/extralanguage/compiler/AbstractExtraLanguageGenerator.java#L593-L599
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/extralanguage/compiler/AbstractExtraLanguageGenerator.java
AbstractExtraLanguageGenerator._generate
protected void _generate(SarlScript script, IExtraLanguageGeneratorContext context) { if (script != null) { for (final XtendTypeDeclaration content : script.getXtendTypes()) { if (context.getCancelIndicator().isCanceled()) { return; } try { generate(content, context); } finally { context.clearData(); } } } }
java
protected void _generate(SarlScript script, IExtraLanguageGeneratorContext context) { if (script != null) { for (final XtendTypeDeclaration content : script.getXtendTypes()) { if (context.getCancelIndicator().isCanceled()) { return; } try { generate(content, context); } finally { context.clearData(); } } } }
[ "protected", "void", "_generate", "(", "SarlScript", "script", ",", "IExtraLanguageGeneratorContext", "context", ")", "{", "if", "(", "script", "!=", "null", ")", "{", "for", "(", "final", "XtendTypeDeclaration", "content", ":", "script", ".", "getXtendTypes", "...
Generate the given script. @param script the script. @param context the context.
[ "Generate", "the", "given", "script", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/extralanguage/compiler/AbstractExtraLanguageGenerator.java#L678-L691
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/extralanguage/compiler/AbstractExtraLanguageGenerator.java
AbstractExtraLanguageGenerator.getSuperTypes
protected static List<JvmTypeReference> getSuperTypes(JvmTypeReference extension, List<? extends JvmTypeReference> implemented) { final List<JvmTypeReference> list = new ArrayList<>(); if (extension != null) { list.add(extension); } if (implemented != null) { list.addAll(implemented); } return list; }
java
protected static List<JvmTypeReference> getSuperTypes(JvmTypeReference extension, List<? extends JvmTypeReference> implemented) { final List<JvmTypeReference> list = new ArrayList<>(); if (extension != null) { list.add(extension); } if (implemented != null) { list.addAll(implemented); } return list; }
[ "protected", "static", "List", "<", "JvmTypeReference", ">", "getSuperTypes", "(", "JvmTypeReference", "extension", ",", "List", "<", "?", "extends", "JvmTypeReference", ">", "implemented", ")", "{", "final", "List", "<", "JvmTypeReference", ">", "list", "=", "n...
Replies the merged list with the extended and implemented types. @param extension the extended type. @param implemented the implemented types. @return the super types.
[ "Replies", "the", "merged", "list", "with", "the", "extended", "and", "implemented", "types", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/extralanguage/compiler/AbstractExtraLanguageGenerator.java#L761-L770
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/extralanguage/compiler/AbstractExtraLanguageGenerator.java
AbstractExtraLanguageGenerator.getExpectedType
protected LightweightTypeReference getExpectedType(XExpression expr) { final IResolvedTypes resolvedTypes = getTypeResolver().resolveTypes(expr); final LightweightTypeReference actualType = resolvedTypes.getActualType(expr); return actualType; }
java
protected LightweightTypeReference getExpectedType(XExpression expr) { final IResolvedTypes resolvedTypes = getTypeResolver().resolveTypes(expr); final LightweightTypeReference actualType = resolvedTypes.getActualType(expr); return actualType; }
[ "protected", "LightweightTypeReference", "getExpectedType", "(", "XExpression", "expr", ")", "{", "final", "IResolvedTypes", "resolvedTypes", "=", "getTypeResolver", "(", ")", ".", "resolveTypes", "(", "expr", ")", ";", "final", "LightweightTypeReference", "actualType",...
Compute the expected type of the given expression. @param expr the expression. @return the expected type of the argument.
[ "Compute", "the", "expected", "type", "of", "the", "given", "expression", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/extralanguage/compiler/AbstractExtraLanguageGenerator.java#L777-L781
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/extralanguage/compiler/AbstractExtraLanguageGenerator.java
AbstractExtraLanguageGenerator.getExpectedType
protected LightweightTypeReference getExpectedType(XtendExecutable executable, JvmTypeReference declaredReturnType) { if (declaredReturnType == null) { // Try to get any inferred return type. if (executable instanceof XtendFunction) { final XtendFunction function = (XtendFunction) executable; final JvmOperation operation = this.sarlAssociations.getDirectlyInferredOperation(function); if (operation != null) { return Utils.toLightweightTypeReference(operation.getReturnType(), this.services); } } if (!getEarlyExitComputer().isEarlyExit(executable.getExpression())) { return getExpectedType(executable.getExpression()); } return null; } if (!"void".equals(declaredReturnType.getIdentifier())) { //$NON-NLS-1$ return Utils.toLightweightTypeReference(declaredReturnType, this.services); } return null; }
java
protected LightweightTypeReference getExpectedType(XtendExecutable executable, JvmTypeReference declaredReturnType) { if (declaredReturnType == null) { // Try to get any inferred return type. if (executable instanceof XtendFunction) { final XtendFunction function = (XtendFunction) executable; final JvmOperation operation = this.sarlAssociations.getDirectlyInferredOperation(function); if (operation != null) { return Utils.toLightweightTypeReference(operation.getReturnType(), this.services); } } if (!getEarlyExitComputer().isEarlyExit(executable.getExpression())) { return getExpectedType(executable.getExpression()); } return null; } if (!"void".equals(declaredReturnType.getIdentifier())) { //$NON-NLS-1$ return Utils.toLightweightTypeReference(declaredReturnType, this.services); } return null; }
[ "protected", "LightweightTypeReference", "getExpectedType", "(", "XtendExecutable", "executable", ",", "JvmTypeReference", "declaredReturnType", ")", "{", "if", "(", "declaredReturnType", "==", "null", ")", "{", "// Try to get any inferred return type.", "if", "(", "executa...
Replies the expected type of the given executable. @param executable the executable. @param declaredReturnType the declared return type, if one. @return the expected type or {@code null} if none ({@code void}).
[ "Replies", "the", "expected", "type", "of", "the", "given", "executable", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/extralanguage/compiler/AbstractExtraLanguageGenerator.java#L789-L808
train
sarl/sarl
main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/util/SerializableProxy.java
SerializableProxy.readResolve
private Object readResolve() throws ObjectStreamException { Constructor<?> compatible = null; for (final Constructor<?> candidate : this.proxyType.getDeclaredConstructors()) { if (candidate != null && isCompatible(candidate)) { if (compatible != null) { throw new IllegalStateException(); } compatible = candidate; } } if (compatible != null) { if (!compatible.isAccessible()) { compatible.setAccessible(true); } try { final Object[] arguments = new Object[this.values.length + 1]; System.arraycopy(this.values, 0, arguments, 1, this.values.length); return compatible.newInstance(arguments); } catch (Exception exception) { throw new WriteAbortedException(exception.getLocalizedMessage(), exception); } } throw new InvalidClassException("compatible constructor not found"); //$NON-NLS-1$ }
java
private Object readResolve() throws ObjectStreamException { Constructor<?> compatible = null; for (final Constructor<?> candidate : this.proxyType.getDeclaredConstructors()) { if (candidate != null && isCompatible(candidate)) { if (compatible != null) { throw new IllegalStateException(); } compatible = candidate; } } if (compatible != null) { if (!compatible.isAccessible()) { compatible.setAccessible(true); } try { final Object[] arguments = new Object[this.values.length + 1]; System.arraycopy(this.values, 0, arguments, 1, this.values.length); return compatible.newInstance(arguments); } catch (Exception exception) { throw new WriteAbortedException(exception.getLocalizedMessage(), exception); } } throw new InvalidClassException("compatible constructor not found"); //$NON-NLS-1$ }
[ "private", "Object", "readResolve", "(", ")", "throws", "ObjectStreamException", "{", "Constructor", "<", "?", ">", "compatible", "=", "null", ";", "for", "(", "final", "Constructor", "<", "?", ">", "candidate", ":", "this", ".", "proxyType", ".", "getDeclar...
This function enables to deserialize an instance of this proxy. @throws ObjectStreamException if the deserialization fails
[ "This", "function", "enables", "to", "deserialize", "an", "instance", "of", "this", "proxy", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.core/src/io/sarl/lang/util/SerializableProxy.java#L73-L96
train
sarl/sarl
main/coreplugins/io.sarl.m2e/src/io/sarl/m2e/config/SARLProjectConfigurator.java
SARLProjectConfigurator.addPreferences
@SuppressWarnings("static-method") protected void addPreferences( IMavenProjectFacade facade, SARLConfiguration config, IProgressMonitor monitor) throws CoreException { final IPath outputPath = makeProjectRelativePath(facade, config.getOutput()); // Set the SARL preferences SARLPreferences.setSpecificSARLConfigurationFor( facade.getProject(), outputPath); }
java
@SuppressWarnings("static-method") protected void addPreferences( IMavenProjectFacade facade, SARLConfiguration config, IProgressMonitor monitor) throws CoreException { final IPath outputPath = makeProjectRelativePath(facade, config.getOutput()); // Set the SARL preferences SARLPreferences.setSpecificSARLConfigurationFor( facade.getProject(), outputPath); }
[ "@", "SuppressWarnings", "(", "\"static-method\"", ")", "protected", "void", "addPreferences", "(", "IMavenProjectFacade", "facade", ",", "SARLConfiguration", "config", ",", "IProgressMonitor", "monitor", ")", "throws", "CoreException", "{", "final", "IPath", "outputPat...
Invoked to add the preferences dedicated to SARL, JRE, etc. @param facade the Maven face. @param config the configuration. @param monitor the monitor. @throws CoreException if cannot add the source folders.
[ "Invoked", "to", "add", "the", "preferences", "dedicated", "to", "SARL", "JRE", "etc", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.m2e/src/io/sarl/m2e/config/SARLProjectConfigurator.java#L108-L116
train
sarl/sarl
main/coreplugins/io.sarl.m2e/src/io/sarl/m2e/config/SARLProjectConfigurator.java
SARLProjectConfigurator.addSourceFolders
@SuppressWarnings({"checkstyle:magicnumber", "checkstyle:npathcomplexity"}) protected void addSourceFolders( IMavenProjectFacade facade, SARLConfiguration config, IClasspathDescriptor classpath, IProgressMonitor monitor) throws CoreException { assertHasNature(facade.getProject(), SARLEclipseConfig.NATURE_ID); assertHasNature(facade.getProject(), SARLEclipseConfig.XTEXT_NATURE_ID); assertHasNature(facade.getProject(), JavaCore.NATURE_ID); final String encoding = config.getEncoding(); final SubMonitor subMonitor = SubMonitor.convert(monitor, 4); // // Add the source folders // // Input folder, e.g. "src/main/sarl" final IPath inputPath = makeFullPath(facade, config.getInput()); final IFolder inputFolder = ensureFolderExists(facade, inputPath, false, subMonitor); if (encoding != null && inputFolder != null && inputFolder.exists()) { inputFolder.setDefaultCharset(encoding, monitor); } IClasspathEntryDescriptor descriptor = classpath.addSourceEntry( inputPath, facade.getOutputLocation(), false); descriptor.setPomDerived(true); subMonitor.worked(1); // Input folder, e.g. "src/main/generated-sources/sarl" final IPath outputPath = makeFullPath(facade, config.getOutput()); final IFolder outputFolder = ensureFolderExists(facade, outputPath, true, subMonitor); if (encoding != null && outputFolder != null && outputFolder.exists()) { outputFolder.setDefaultCharset(encoding, monitor); } descriptor = classpath.addSourceEntry( outputPath, facade.getOutputLocation(), false); descriptor.setPomDerived(true); descriptor.setClasspathAttribute(IClasspathAttribute.IGNORE_OPTIONAL_PROBLEMS, Boolean.TRUE.toString()); subMonitor.worked(1); // Test input folder, e.g. "src/test/sarl" final IPath testInputPath = makeFullPath(facade, config.getTestInput()); final IFolder testInputFolder = ensureFolderExists(facade, testInputPath, false, subMonitor); if (encoding != null && testInputFolder != null && testInputFolder.exists()) { testInputFolder.setDefaultCharset(encoding, monitor); } descriptor = classpath.addSourceEntry( testInputPath, facade.getTestOutputLocation(), true); descriptor.setPomDerived(true); descriptor.setClasspathAttribute(IClasspathAttribute.TEST, Boolean.TRUE.toString()); subMonitor.worked(1); // Test input folder, e.g. "src/test/generated-sources/sarl" final IPath testOutputPath = makeFullPath(facade, config.getTestOutput()); final IFolder testOutputFolder = ensureFolderExists(facade, testOutputPath, true, subMonitor); if (encoding != null && testOutputFolder != null && testOutputFolder.exists()) { testOutputFolder.setDefaultCharset(encoding, monitor); } descriptor = classpath.addSourceEntry( testOutputPath, facade.getTestOutputLocation(), true); descriptor.setPomDerived(true); descriptor.setClasspathAttribute(IClasspathAttribute.IGNORE_OPTIONAL_PROBLEMS, Boolean.TRUE.toString()); descriptor.setClasspathAttribute(IClasspathAttribute.TEST, Boolean.TRUE.toString()); subMonitor.done(); }
java
@SuppressWarnings({"checkstyle:magicnumber", "checkstyle:npathcomplexity"}) protected void addSourceFolders( IMavenProjectFacade facade, SARLConfiguration config, IClasspathDescriptor classpath, IProgressMonitor monitor) throws CoreException { assertHasNature(facade.getProject(), SARLEclipseConfig.NATURE_ID); assertHasNature(facade.getProject(), SARLEclipseConfig.XTEXT_NATURE_ID); assertHasNature(facade.getProject(), JavaCore.NATURE_ID); final String encoding = config.getEncoding(); final SubMonitor subMonitor = SubMonitor.convert(monitor, 4); // // Add the source folders // // Input folder, e.g. "src/main/sarl" final IPath inputPath = makeFullPath(facade, config.getInput()); final IFolder inputFolder = ensureFolderExists(facade, inputPath, false, subMonitor); if (encoding != null && inputFolder != null && inputFolder.exists()) { inputFolder.setDefaultCharset(encoding, monitor); } IClasspathEntryDescriptor descriptor = classpath.addSourceEntry( inputPath, facade.getOutputLocation(), false); descriptor.setPomDerived(true); subMonitor.worked(1); // Input folder, e.g. "src/main/generated-sources/sarl" final IPath outputPath = makeFullPath(facade, config.getOutput()); final IFolder outputFolder = ensureFolderExists(facade, outputPath, true, subMonitor); if (encoding != null && outputFolder != null && outputFolder.exists()) { outputFolder.setDefaultCharset(encoding, monitor); } descriptor = classpath.addSourceEntry( outputPath, facade.getOutputLocation(), false); descriptor.setPomDerived(true); descriptor.setClasspathAttribute(IClasspathAttribute.IGNORE_OPTIONAL_PROBLEMS, Boolean.TRUE.toString()); subMonitor.worked(1); // Test input folder, e.g. "src/test/sarl" final IPath testInputPath = makeFullPath(facade, config.getTestInput()); final IFolder testInputFolder = ensureFolderExists(facade, testInputPath, false, subMonitor); if (encoding != null && testInputFolder != null && testInputFolder.exists()) { testInputFolder.setDefaultCharset(encoding, monitor); } descriptor = classpath.addSourceEntry( testInputPath, facade.getTestOutputLocation(), true); descriptor.setPomDerived(true); descriptor.setClasspathAttribute(IClasspathAttribute.TEST, Boolean.TRUE.toString()); subMonitor.worked(1); // Test input folder, e.g. "src/test/generated-sources/sarl" final IPath testOutputPath = makeFullPath(facade, config.getTestOutput()); final IFolder testOutputFolder = ensureFolderExists(facade, testOutputPath, true, subMonitor); if (encoding != null && testOutputFolder != null && testOutputFolder.exists()) { testOutputFolder.setDefaultCharset(encoding, monitor); } descriptor = classpath.addSourceEntry( testOutputPath, facade.getTestOutputLocation(), true); descriptor.setPomDerived(true); descriptor.setClasspathAttribute(IClasspathAttribute.IGNORE_OPTIONAL_PROBLEMS, Boolean.TRUE.toString()); descriptor.setClasspathAttribute(IClasspathAttribute.TEST, Boolean.TRUE.toString()); subMonitor.done(); }
[ "@", "SuppressWarnings", "(", "{", "\"checkstyle:magicnumber\"", ",", "\"checkstyle:npathcomplexity\"", "}", ")", "protected", "void", "addSourceFolders", "(", "IMavenProjectFacade", "facade", ",", "SARLConfiguration", "config", ",", "IClasspathDescriptor", "classpath", ","...
Invoked to add the source folders. @param facade the facade of the Maven project. @param config the configuration. @param classpath the project classpath. @param monitor the monitor. @throws CoreException if cannot add the source folders.
[ "Invoked", "to", "add", "the", "source", "folders", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.m2e/src/io/sarl/m2e/config/SARLProjectConfigurator.java#L157-L229
train
sarl/sarl
main/coreplugins/io.sarl.m2e/src/io/sarl/m2e/config/SARLProjectConfigurator.java
SARLProjectConfigurator.getParameterValue
protected <T> T getParameterValue(MavenProject project, String parameter, Class<T> asType, MojoExecution mojoExecution, IProgressMonitor monitor, T defaultValue) throws CoreException { T value = getParameterValue(project, parameter, asType, mojoExecution, monitor); if (value == null) { value = defaultValue; } return value; }
java
protected <T> T getParameterValue(MavenProject project, String parameter, Class<T> asType, MojoExecution mojoExecution, IProgressMonitor monitor, T defaultValue) throws CoreException { T value = getParameterValue(project, parameter, asType, mojoExecution, monitor); if (value == null) { value = defaultValue; } return value; }
[ "protected", "<", "T", ">", "T", "getParameterValue", "(", "MavenProject", "project", ",", "String", "parameter", ",", "Class", "<", "T", ">", "asType", ",", "MojoExecution", "mojoExecution", ",", "IProgressMonitor", "monitor", ",", "T", "defaultValue", ")", "...
Replies the configuration value. @param <T> - the expected type. @param project the project. @param parameter the parameter name. @param asType the expected type. @param mojoExecution the mojo execution. @param monitor the monitor. @param defaultValue the default value. @return the value of the parameter. @throws CoreException if cannot read the value.
[ "Replies", "the", "configuration", "value", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.m2e/src/io/sarl/m2e/config/SARLProjectConfigurator.java#L243-L250
train
sarl/sarl
main/coreplugins/io.sarl.m2e/src/io/sarl/m2e/config/SARLProjectConfigurator.java
SARLProjectConfigurator.readConfiguration
protected SARLConfiguration readConfiguration(ProjectConfigurationRequest request, IProgressMonitor monitor) throws CoreException { SARLConfiguration initConfig = null; SARLConfiguration compileConfig = null; final List<MojoExecution> mojos = getMojoExecutions(request, monitor); for (final MojoExecution mojo : mojos) { final String goal = mojo.getGoal(); switch (goal) { case "initialize": //$NON-NLS-1$ initConfig = readInitializeConfiguration(request, mojo, monitor); break; case "compile": //$NON-NLS-1$ compileConfig = readCompileConfiguration(request, mojo, monitor); break; default: } } if (compileConfig != null && initConfig != null) { compileConfig.setFrom(initConfig); } return compileConfig; }
java
protected SARLConfiguration readConfiguration(ProjectConfigurationRequest request, IProgressMonitor monitor) throws CoreException { SARLConfiguration initConfig = null; SARLConfiguration compileConfig = null; final List<MojoExecution> mojos = getMojoExecutions(request, monitor); for (final MojoExecution mojo : mojos) { final String goal = mojo.getGoal(); switch (goal) { case "initialize": //$NON-NLS-1$ initConfig = readInitializeConfiguration(request, mojo, monitor); break; case "compile": //$NON-NLS-1$ compileConfig = readCompileConfiguration(request, mojo, monitor); break; default: } } if (compileConfig != null && initConfig != null) { compileConfig.setFrom(initConfig); } return compileConfig; }
[ "protected", "SARLConfiguration", "readConfiguration", "(", "ProjectConfigurationRequest", "request", ",", "IProgressMonitor", "monitor", ")", "throws", "CoreException", "{", "SARLConfiguration", "initConfig", "=", "null", ";", "SARLConfiguration", "compileConfig", "=", "nu...
Read the SARL configuration. @param request the configuration request. @param monitor the monitor. @return the SARL configuration. @throws CoreException if something wrong appends.
[ "Read", "the", "SARL", "configuration", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.m2e/src/io/sarl/m2e/config/SARLProjectConfigurator.java#L259-L284
train
sarl/sarl
main/coreplugins/io.sarl.m2e/src/io/sarl/m2e/config/SARLProjectConfigurator.java
SARLProjectConfigurator.readInitializeConfiguration
private SARLConfiguration readInitializeConfiguration( ProjectConfigurationRequest request, MojoExecution mojo, IProgressMonitor monitor) throws CoreException { final SARLConfiguration config = new SARLConfiguration(); final MavenProject project = request.getMavenProject(); final File input = getParameterValue(project, "input", File.class, mojo, monitor, //$NON-NLS-1$ new File(SARLConfig.FOLDER_SOURCE_SARL)); final File output = getParameterValue(project, "output", File.class, mojo, monitor, //$NON-NLS-1$ new File(SARLConfig.FOLDER_SOURCE_GENERATED)); final File binOutput = getParameterValue(project, "binOutput", File.class, mojo, monitor, //$NON-NLS-1$ new File(SARLConfig.FOLDER_BIN)); final File testInput = getParameterValue(project, "testInput", File.class, mojo, monitor, //$NON-NLS-1$ new File(SARLConfig.FOLDER_TEST_SOURCE_SARL)); final File testOutput = getParameterValue(project, "testOutput", File.class, mojo, monitor, //$NON-NLS-1$ new File(SARLConfig.FOLDER_TEST_SOURCE_GENERATED)); final File testBinOutput = getParameterValue(project, "testBinOutput", File.class, mojo, monitor, //$NON-NLS-1$ new File(SARLConfig.FOLDER_TEST_BIN)); config.setInput(input); config.setOutput(output); config.setBinOutput(binOutput); config.setTestInput(testInput); config.setTestOutput(testOutput); config.setTestBinOutput(testBinOutput); return config; }
java
private SARLConfiguration readInitializeConfiguration( ProjectConfigurationRequest request, MojoExecution mojo, IProgressMonitor monitor) throws CoreException { final SARLConfiguration config = new SARLConfiguration(); final MavenProject project = request.getMavenProject(); final File input = getParameterValue(project, "input", File.class, mojo, monitor, //$NON-NLS-1$ new File(SARLConfig.FOLDER_SOURCE_SARL)); final File output = getParameterValue(project, "output", File.class, mojo, monitor, //$NON-NLS-1$ new File(SARLConfig.FOLDER_SOURCE_GENERATED)); final File binOutput = getParameterValue(project, "binOutput", File.class, mojo, monitor, //$NON-NLS-1$ new File(SARLConfig.FOLDER_BIN)); final File testInput = getParameterValue(project, "testInput", File.class, mojo, monitor, //$NON-NLS-1$ new File(SARLConfig.FOLDER_TEST_SOURCE_SARL)); final File testOutput = getParameterValue(project, "testOutput", File.class, mojo, monitor, //$NON-NLS-1$ new File(SARLConfig.FOLDER_TEST_SOURCE_GENERATED)); final File testBinOutput = getParameterValue(project, "testBinOutput", File.class, mojo, monitor, //$NON-NLS-1$ new File(SARLConfig.FOLDER_TEST_BIN)); config.setInput(input); config.setOutput(output); config.setBinOutput(binOutput); config.setTestInput(testInput); config.setTestOutput(testOutput); config.setTestBinOutput(testBinOutput); return config; }
[ "private", "SARLConfiguration", "readInitializeConfiguration", "(", "ProjectConfigurationRequest", "request", ",", "MojoExecution", "mojo", ",", "IProgressMonitor", "monitor", ")", "throws", "CoreException", "{", "final", "SARLConfiguration", "config", "=", "new", "SARLConf...
Read the configuration for the Initialize mojo. @param request the request. @param mojo the mojo execution. @param monitor the monitor. @return the configuration. @throws CoreException error in the eCore configuration.
[ "Read", "the", "configuration", "for", "the", "Initialize", "mojo", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.m2e/src/io/sarl/m2e/config/SARLProjectConfigurator.java#L294-L322
train
sarl/sarl
main/coreplugins/io.sarl.m2e/src/io/sarl/m2e/config/SARLProjectConfigurator.java
SARLProjectConfigurator.readCompileConfiguration
private SARLConfiguration readCompileConfiguration( ProjectConfigurationRequest request, MojoExecution mojo, IProgressMonitor monitor) throws CoreException { final SARLConfiguration config = new SARLConfiguration(); final MavenProject project = request.getMavenProject(); final File input = getParameterValue(project, "input", File.class, mojo, monitor); //$NON-NLS-1$ final File output = getParameterValue(project, "output", File.class, mojo, monitor); //$NON-NLS-1$ final File binOutput = getParameterValue(project, "binOutput", File.class, mojo, monitor); //$NON-NLS-1$ final File testInput = getParameterValue(project, "testInput", File.class, mojo, monitor); //$NON-NLS-1$ final File testOutput = getParameterValue(project, "testOutput", File.class, mojo, monitor); //$NON-NLS-1$ final File testBinOutput = getParameterValue(project, "testBinOutput", File.class, mojo, monitor); //$NON-NLS-1$ config.setInput(input); config.setOutput(output); config.setBinOutput(binOutput); config.setTestInput(testInput); config.setTestOutput(testOutput); config.setTestBinOutput(testBinOutput); final String inputCompliance = getParameterValue(project, "source", String.class, mojo, monitor); //$NON-NLS-1$ final String outputCompliance = getParameterValue(project, "target", String.class, mojo, monitor); //$NON-NLS-1$ config.setInputCompliance(inputCompliance); config.setOutputCompliance(outputCompliance); final String encoding = getParameterValue(project, "encoding", String.class, mojo, monitor); //$NON-NLS-1$ config.setEncoding(encoding); return config; }
java
private SARLConfiguration readCompileConfiguration( ProjectConfigurationRequest request, MojoExecution mojo, IProgressMonitor monitor) throws CoreException { final SARLConfiguration config = new SARLConfiguration(); final MavenProject project = request.getMavenProject(); final File input = getParameterValue(project, "input", File.class, mojo, monitor); //$NON-NLS-1$ final File output = getParameterValue(project, "output", File.class, mojo, monitor); //$NON-NLS-1$ final File binOutput = getParameterValue(project, "binOutput", File.class, mojo, monitor); //$NON-NLS-1$ final File testInput = getParameterValue(project, "testInput", File.class, mojo, monitor); //$NON-NLS-1$ final File testOutput = getParameterValue(project, "testOutput", File.class, mojo, monitor); //$NON-NLS-1$ final File testBinOutput = getParameterValue(project, "testBinOutput", File.class, mojo, monitor); //$NON-NLS-1$ config.setInput(input); config.setOutput(output); config.setBinOutput(binOutput); config.setTestInput(testInput); config.setTestOutput(testOutput); config.setTestBinOutput(testBinOutput); final String inputCompliance = getParameterValue(project, "source", String.class, mojo, monitor); //$NON-NLS-1$ final String outputCompliance = getParameterValue(project, "target", String.class, mojo, monitor); //$NON-NLS-1$ config.setInputCompliance(inputCompliance); config.setOutputCompliance(outputCompliance); final String encoding = getParameterValue(project, "encoding", String.class, mojo, monitor); //$NON-NLS-1$ config.setEncoding(encoding); return config; }
[ "private", "SARLConfiguration", "readCompileConfiguration", "(", "ProjectConfigurationRequest", "request", ",", "MojoExecution", "mojo", ",", "IProgressMonitor", "monitor", ")", "throws", "CoreException", "{", "final", "SARLConfiguration", "config", "=", "new", "SARLConfigu...
Read the configuration for the Compilation mojo. @param request the request. @param mojo the mojo execution. @param monitor the monitor. @return the configuration. @throws CoreException error in the eCore configuration.
[ "Read", "the", "configuration", "for", "the", "Compilation", "mojo", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.m2e/src/io/sarl/m2e/config/SARLProjectConfigurator.java#L332-L363
train
sarl/sarl
main/coreplugins/io.sarl.m2e/src/io/sarl/m2e/config/SARLProjectConfigurator.java
SARLProjectConfigurator.addSarlLibraries
@SuppressWarnings("static-method") protected void addSarlLibraries(IClasspathDescriptor classpath) { final IClasspathEntry entry = JavaCore.newContainerEntry(SARLClasspathContainerInitializer.CONTAINER_ID); classpath.addEntry(entry); }
java
@SuppressWarnings("static-method") protected void addSarlLibraries(IClasspathDescriptor classpath) { final IClasspathEntry entry = JavaCore.newContainerEntry(SARLClasspathContainerInitializer.CONTAINER_ID); classpath.addEntry(entry); }
[ "@", "SuppressWarnings", "(", "\"static-method\"", ")", "protected", "void", "addSarlLibraries", "(", "IClasspathDescriptor", "classpath", ")", "{", "final", "IClasspathEntry", "entry", "=", "JavaCore", ".", "newContainerEntry", "(", "SARLClasspathContainerInitializer", "...
Add the SARL libraries into the given classpath. @param classpath the classpath to update.
[ "Add", "the", "SARL", "libraries", "into", "the", "given", "classpath", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.m2e/src/io/sarl/m2e/config/SARLProjectConfigurator.java#L378-L382
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/extralanguage/compiler/ExtraLanguageTypeConverter.java
ExtraLanguageTypeConverter.hasConversion
public boolean hasConversion(String type) { if ((isImplicitSarlTypes() && type.startsWith(IMPLICIT_PACKAGE)) || isImplicitJvmTypes()) { return true; } if (this.mapping == null) { this.mapping = initMapping(); } return this.mapping.containsKey(type); }
java
public boolean hasConversion(String type) { if ((isImplicitSarlTypes() && type.startsWith(IMPLICIT_PACKAGE)) || isImplicitJvmTypes()) { return true; } if (this.mapping == null) { this.mapping = initMapping(); } return this.mapping.containsKey(type); }
[ "public", "boolean", "hasConversion", "(", "String", "type", ")", "{", "if", "(", "(", "isImplicitSarlTypes", "(", ")", "&&", "type", ".", "startsWith", "(", "IMPLICIT_PACKAGE", ")", ")", "||", "isImplicitJvmTypes", "(", ")", ")", "{", "return", "true", ";...
Indicates if the given name has a mapping to the extra language. @param type the type to convert. @return {@code true} if the mapping exists.
[ "Indicates", "if", "the", "given", "name", "has", "a", "mapping", "to", "the", "extra", "language", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/extralanguage/compiler/ExtraLanguageTypeConverter.java#L143-L152
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/extralanguage/compiler/ExtraLanguageTypeConverter.java
ExtraLanguageTypeConverter.convert
public String convert(String type) { if (isImplicitSarlTypes() && type.startsWith(IMPLICIT_PACKAGE)) { return type; } if (this.mapping == null) { this.mapping = initMapping(); } final String map = this.mapping.get(type); if (map != null) { if (map.isEmpty() && !isImplicitJvmTypes()) { return null; } return map; } if (isImplicitJvmTypes()) { return type; } return null; }
java
public String convert(String type) { if (isImplicitSarlTypes() && type.startsWith(IMPLICIT_PACKAGE)) { return type; } if (this.mapping == null) { this.mapping = initMapping(); } final String map = this.mapping.get(type); if (map != null) { if (map.isEmpty() && !isImplicitJvmTypes()) { return null; } return map; } if (isImplicitJvmTypes()) { return type; } return null; }
[ "public", "String", "convert", "(", "String", "type", ")", "{", "if", "(", "isImplicitSarlTypes", "(", ")", "&&", "type", ".", "startsWith", "(", "IMPLICIT_PACKAGE", ")", ")", "{", "return", "type", ";", "}", "if", "(", "this", ".", "mapping", "==", "n...
Convert the given type to its equivalent in the extra language. @param type the type to convert. @return the conversion result, or {@code null} if no equivalent exist.
[ "Convert", "the", "given", "type", "to", "its", "equivalent", "in", "the", "extra", "language", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/extralanguage/compiler/ExtraLanguageTypeConverter.java#L159-L177
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/InheritanceHelper.java
InheritanceHelper.isSarlAgent
public boolean isSarlAgent(LightweightTypeReference type) { return !type.isInterfaceType() && (getSarlElementEcoreType(type) == SarlPackage.SARL_AGENT || type.isSubtypeOf(Agent.class)); }
java
public boolean isSarlAgent(LightweightTypeReference type) { return !type.isInterfaceType() && (getSarlElementEcoreType(type) == SarlPackage.SARL_AGENT || type.isSubtypeOf(Agent.class)); }
[ "public", "boolean", "isSarlAgent", "(", "LightweightTypeReference", "type", ")", "{", "return", "!", "type", ".", "isInterfaceType", "(", ")", "&&", "(", "getSarlElementEcoreType", "(", "type", ")", "==", "SarlPackage", ".", "SARL_AGENT", "||", "type", ".", "...
Replies if the given JVM element is a SARL agent. @param type the JVM type to test. @return {@code true} if the given type is a SARL agent, or not. @since 0.8
[ "Replies", "if", "the", "given", "JVM", "element", "is", "a", "SARL", "agent", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/InheritanceHelper.java#L253-L256
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/InheritanceHelper.java
InheritanceHelper.isSarlBehavior
public boolean isSarlBehavior(LightweightTypeReference type) { return !type.isInterfaceType() && (getSarlElementEcoreType(type) == SarlPackage.SARL_BEHAVIOR || type.isSubtypeOf(Behavior.class)); }
java
public boolean isSarlBehavior(LightweightTypeReference type) { return !type.isInterfaceType() && (getSarlElementEcoreType(type) == SarlPackage.SARL_BEHAVIOR || type.isSubtypeOf(Behavior.class)); }
[ "public", "boolean", "isSarlBehavior", "(", "LightweightTypeReference", "type", ")", "{", "return", "!", "type", ".", "isInterfaceType", "(", ")", "&&", "(", "getSarlElementEcoreType", "(", "type", ")", "==", "SarlPackage", ".", "SARL_BEHAVIOR", "||", "type", "....
Replies if the given JVM element is a SARL behavior. @param type the JVM type to test. @return {@code true} if the given type is a SARL behavior, or not. @since 0.8
[ "Replies", "if", "the", "given", "JVM", "element", "is", "a", "SARL", "behavior", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/InheritanceHelper.java#L274-L277
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/InheritanceHelper.java
InheritanceHelper.isSarlCapacity
public boolean isSarlCapacity(LightweightTypeReference type) { return type.isInterfaceType() && (getSarlElementEcoreType(type) == SarlPackage.SARL_CAPACITY || type.isSubtypeOf(Capacity.class)); }
java
public boolean isSarlCapacity(LightweightTypeReference type) { return type.isInterfaceType() && (getSarlElementEcoreType(type) == SarlPackage.SARL_CAPACITY || type.isSubtypeOf(Capacity.class)); }
[ "public", "boolean", "isSarlCapacity", "(", "LightweightTypeReference", "type", ")", "{", "return", "type", ".", "isInterfaceType", "(", ")", "&&", "(", "getSarlElementEcoreType", "(", "type", ")", "==", "SarlPackage", ".", "SARL_CAPACITY", "||", "type", ".", "i...
Replies if the given JVM element is a SARL capacity. @param type the JVM type to test. @return {@code true} if the given type is a SARL capacity, or not. @since 0.8
[ "Replies", "if", "the", "given", "JVM", "element", "is", "a", "SARL", "capacity", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/InheritanceHelper.java#L295-L298
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/InheritanceHelper.java
InheritanceHelper.isSarlEvent
public boolean isSarlEvent(LightweightTypeReference type) { return !type.isInterfaceType() && (getSarlElementEcoreType(type) == SarlPackage.SARL_EVENT || type.isSubtypeOf(Event.class)); }
java
public boolean isSarlEvent(LightweightTypeReference type) { return !type.isInterfaceType() && (getSarlElementEcoreType(type) == SarlPackage.SARL_EVENT || type.isSubtypeOf(Event.class)); }
[ "public", "boolean", "isSarlEvent", "(", "LightweightTypeReference", "type", ")", "{", "return", "!", "type", ".", "isInterfaceType", "(", ")", "&&", "(", "getSarlElementEcoreType", "(", "type", ")", "==", "SarlPackage", ".", "SARL_EVENT", "||", "type", ".", "...
Replies if the given JVM element is a SARL event. @param type the JVM type to test. @return {@code true} if the given type is a SARL event, or not. @since 0.8
[ "Replies", "if", "the", "given", "JVM", "element", "is", "a", "SARL", "event", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/InheritanceHelper.java#L316-L319
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/InheritanceHelper.java
InheritanceHelper.isSarlSkill
public boolean isSarlSkill(LightweightTypeReference type) { return !type.isInterfaceType() && (getSarlElementEcoreType(type) == SarlPackage.SARL_SKILL || type.isSubtypeOf(Skill.class)); }
java
public boolean isSarlSkill(LightweightTypeReference type) { return !type.isInterfaceType() && (getSarlElementEcoreType(type) == SarlPackage.SARL_SKILL || type.isSubtypeOf(Skill.class)); }
[ "public", "boolean", "isSarlSkill", "(", "LightweightTypeReference", "type", ")", "{", "return", "!", "type", ".", "isInterfaceType", "(", ")", "&&", "(", "getSarlElementEcoreType", "(", "type", ")", "==", "SarlPackage", ".", "SARL_SKILL", "||", "type", ".", "...
Replies if the given JVM element is a SARL skill. @param type the JVM type to test. @return {@code true} if the given type is a SARL skill, or not. @since 0.8
[ "Replies", "if", "the", "given", "JVM", "element", "is", "a", "SARL", "skill", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/InheritanceHelper.java#L337-L340
train
sarl/sarl
sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/repository/MultipleAddressParticipantRepository.java
MultipleAddressParticipantRepository.unregisterParticipant
public ADDRESST unregisterParticipant(ADDRESST address, EventListener entity) { synchronized (mutex()) { removeListener(address); this.participants.remove(entity.getID(), address); } return address; }
java
public ADDRESST unregisterParticipant(ADDRESST address, EventListener entity) { synchronized (mutex()) { removeListener(address); this.participants.remove(entity.getID(), address); } return address; }
[ "public", "ADDRESST", "unregisterParticipant", "(", "ADDRESST", "address", ",", "EventListener", "entity", ")", "{", "synchronized", "(", "mutex", "(", ")", ")", "{", "removeListener", "(", "address", ")", ";", "this", ".", "participants", ".", "remove", "(", ...
Remove a participant from this repository. @param address address of a participant to remove from this repository. @param entity participant to unmap to the given address. @return a.
[ "Remove", "a", "participant", "from", "this", "repository", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/repository/MultipleAddressParticipantRepository.java#L101-L107
train
sarl/sarl
sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/repository/MultipleAddressParticipantRepository.java
MultipleAddressParticipantRepository.getAddresses
public SynchronizedCollection<ADDRESST> getAddresses(UUID participant) { final Object mutex = mutex(); synchronized (mutex) { return Collections3.synchronizedCollection(this.participants.get(participant), mutex); } }
java
public SynchronizedCollection<ADDRESST> getAddresses(UUID participant) { final Object mutex = mutex(); synchronized (mutex) { return Collections3.synchronizedCollection(this.participants.get(participant), mutex); } }
[ "public", "SynchronizedCollection", "<", "ADDRESST", ">", "getAddresses", "(", "UUID", "participant", ")", "{", "final", "Object", "mutex", "=", "mutex", "(", ")", ";", "synchronized", "(", "mutex", ")", "{", "return", "Collections3", ".", "synchronizedCollectio...
Replies all the addresses of the participant with the given identifier. @param participant the identifier of the participant. @return the collection of addresses. It may be <code>null</code> if the participant is unknown.
[ "Replies", "all", "the", "addresses", "of", "the", "participant", "with", "the", "given", "identifier", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/repository/MultipleAddressParticipantRepository.java#L115-L120
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/jvmmodel/SARLReadAndWriteTracking.java
SARLReadAndWriteTracking.markAssignmentAccess
public boolean markAssignmentAccess(EObject object) { assert object != null; if (!isAssigned(object)) { return object.eAdapters().add(ASSIGNMENT_MARKER); } return false; }
java
public boolean markAssignmentAccess(EObject object) { assert object != null; if (!isAssigned(object)) { return object.eAdapters().add(ASSIGNMENT_MARKER); } return false; }
[ "public", "boolean", "markAssignmentAccess", "(", "EObject", "object", ")", "{", "assert", "object", "!=", "null", ";", "if", "(", "!", "isAssigned", "(", "object", ")", ")", "{", "return", "object", ".", "eAdapters", "(", ")", ".", "add", "(", "ASSIGNME...
Mark the given object as an assigned object after its initialization. <p>The given object has its value changed by a assignment operation. @param object the written object. @return {@code true} if the write flag has changed.
[ "Mark", "the", "given", "object", "as", "an", "assigned", "object", "after", "its", "initialization", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/jvmmodel/SARLReadAndWriteTracking.java#L74-L80
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/jvmmodel/SARLReadAndWriteTracking.java
SARLReadAndWriteTracking.isAssigned
@SuppressWarnings("static-method") public boolean isAssigned(final EObject object) { assert object != null; return object.eAdapters().contains(ASSIGNMENT_MARKER); }
java
@SuppressWarnings("static-method") public boolean isAssigned(final EObject object) { assert object != null; return object.eAdapters().contains(ASSIGNMENT_MARKER); }
[ "@", "SuppressWarnings", "(", "\"static-method\"", ")", "public", "boolean", "isAssigned", "(", "final", "EObject", "object", ")", "{", "assert", "object", "!=", "null", ";", "return", "object", ".", "eAdapters", "(", ")", ".", "contains", "(", "ASSIGNMENT_MAR...
Replies if the given object was marked as assigned within the current compilation unit. @param object the object to test. @return {@code true} if the object was written within the current compilation unit; {@code false} if is is not written within the current compilation unit.
[ "Replies", "if", "the", "given", "object", "was", "marked", "as", "assigned", "within", "the", "current", "compilation", "unit", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/jvmmodel/SARLReadAndWriteTracking.java#L88-L92
train
sarl/sarl
main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/codebuilder/SarlMethodBuilder.java
SarlMethodBuilder.appendFiresClause
protected ISourceAppender appendFiresClause(ISourceAppender appendable) { final List<LightweightTypeReference> types = getFires(); final Iterator<LightweightTypeReference> iterator = types.iterator(); if (iterator.hasNext()) { appendable.append(" ").append(this.keywords.getFiresKeyword()).append(" "); //$NON-NLS-1$ //$NON-NLS-2$ do { final LightweightTypeReference type = iterator.next(); appendable.append(type); if (iterator.hasNext()) { appendable.append(this.keywords.getCommaKeyword()).append(" "); //$NON-NLS-1$ } } while (iterator.hasNext()); } return appendable; }
java
protected ISourceAppender appendFiresClause(ISourceAppender appendable) { final List<LightweightTypeReference> types = getFires(); final Iterator<LightweightTypeReference> iterator = types.iterator(); if (iterator.hasNext()) { appendable.append(" ").append(this.keywords.getFiresKeyword()).append(" "); //$NON-NLS-1$ //$NON-NLS-2$ do { final LightweightTypeReference type = iterator.next(); appendable.append(type); if (iterator.hasNext()) { appendable.append(this.keywords.getCommaKeyword()).append(" "); //$NON-NLS-1$ } } while (iterator.hasNext()); } return appendable; }
[ "protected", "ISourceAppender", "appendFiresClause", "(", "ISourceAppender", "appendable", ")", "{", "final", "List", "<", "LightweightTypeReference", ">", "types", "=", "getFires", "(", ")", ";", "final", "Iterator", "<", "LightweightTypeReference", ">", "iterator", ...
Append the "fires" clause. @param appendable the receiver. @return the appendable.
[ "Append", "the", "fires", "clause", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/codebuilder/SarlMethodBuilder.java#L133-L147
train
sarl/sarl
main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/preferences/SARLPreferences.java
SARLPreferences.getSARLPreferencesFor
public static IPreferenceStore getSARLPreferencesFor(IProject project) { if (project != null) { final Injector injector = LangActivator.getInstance().getInjector(LangActivator.IO_SARL_LANG_SARL); final IPreferenceStoreAccess preferenceStoreAccess = injector.getInstance(IPreferenceStoreAccess.class); return preferenceStoreAccess.getWritablePreferenceStore(project); } return null; }
java
public static IPreferenceStore getSARLPreferencesFor(IProject project) { if (project != null) { final Injector injector = LangActivator.getInstance().getInjector(LangActivator.IO_SARL_LANG_SARL); final IPreferenceStoreAccess preferenceStoreAccess = injector.getInstance(IPreferenceStoreAccess.class); return preferenceStoreAccess.getWritablePreferenceStore(project); } return null; }
[ "public", "static", "IPreferenceStore", "getSARLPreferencesFor", "(", "IProject", "project", ")", "{", "if", "(", "project", "!=", "null", ")", "{", "final", "Injector", "injector", "=", "LangActivator", ".", "getInstance", "(", ")", ".", "getInjector", "(", "...
Replies the preference store for the given project. @param project the project. @return the preference store or <code>null</code>.
[ "Replies", "the", "preference", "store", "for", "the", "given", "project", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/preferences/SARLPreferences.java#L69-L76
train
sarl/sarl
main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/preferences/SARLPreferences.java
SARLPreferences.getXtextConfigurationsFor
public static Set<OutputConfiguration> getXtextConfigurationsFor(IProject project) { final Injector injector = LangActivator.getInstance().getInjector(LangActivator.IO_SARL_LANG_SARL); final EclipseOutputConfigurationProvider configurationProvider = injector.getInstance(EclipseOutputConfigurationProvider.class); return configurationProvider.getOutputConfigurations(project); }
java
public static Set<OutputConfiguration> getXtextConfigurationsFor(IProject project) { final Injector injector = LangActivator.getInstance().getInjector(LangActivator.IO_SARL_LANG_SARL); final EclipseOutputConfigurationProvider configurationProvider = injector.getInstance(EclipseOutputConfigurationProvider.class); return configurationProvider.getOutputConfigurations(project); }
[ "public", "static", "Set", "<", "OutputConfiguration", ">", "getXtextConfigurationsFor", "(", "IProject", "project", ")", "{", "final", "Injector", "injector", "=", "LangActivator", ".", "getInstance", "(", ")", ".", "getInjector", "(", "LangActivator", ".", "IO_S...
Replies the Xtext output configurations related to the given project. @param project the project. @return the Xtext output configurations.
[ "Replies", "the", "Xtext", "output", "configurations", "related", "to", "the", "given", "project", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/preferences/SARLPreferences.java#L83-L88
train
sarl/sarl
main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/preferences/SARLPreferences.java
SARLPreferences.setSystemSARLConfigurationFor
public static void setSystemSARLConfigurationFor(IProject project) { final IPreferenceStore preferenceStore = getSARLPreferencesFor(project); preferenceStore.setValue(IS_PROJECT_SPECIFIC, false); }
java
public static void setSystemSARLConfigurationFor(IProject project) { final IPreferenceStore preferenceStore = getSARLPreferencesFor(project); preferenceStore.setValue(IS_PROJECT_SPECIFIC, false); }
[ "public", "static", "void", "setSystemSARLConfigurationFor", "(", "IProject", "project", ")", "{", "final", "IPreferenceStore", "preferenceStore", "=", "getSARLPreferencesFor", "(", "project", ")", ";", "preferenceStore", ".", "setValue", "(", "IS_PROJECT_SPECIFIC", ","...
Configure the given project for using the system-wide configuration related to SARL. @param project the project.
[ "Configure", "the", "given", "project", "for", "using", "the", "system", "-", "wide", "configuration", "related", "to", "SARL", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/preferences/SARLPreferences.java#L95-L98
train
sarl/sarl
main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/preferences/SARLPreferences.java
SARLPreferences.setSpecificSARLConfigurationFor
public static void setSpecificSARLConfigurationFor( IProject project, IPath outputPath) { final IPreferenceStore preferenceStore = getSARLPreferencesFor(project); // Force to use a specific configuration for the SARL preferenceStore.setValue(IS_PROJECT_SPECIFIC, true); // Loop on the Xtext configurations embedded in the SARL compiler. String key; for (final OutputConfiguration projectConfiguration : getXtextConfigurationsFor(project)) { // // OUTPUT PATH key = BuilderPreferenceAccess.getKey( projectConfiguration, EclipseOutputConfigurationProvider.OUTPUT_DIRECTORY); preferenceStore.setValue(key, outputPath.toOSString()); // // CREATE THE OUTPUT DIRECTORY key = BuilderPreferenceAccess.getKey( projectConfiguration, EclipseOutputConfigurationProvider.OUTPUT_CREATE_DIRECTORY); preferenceStore.setValue(key, true); // // OVERWRITE THE EXISTING FILES key = BuilderPreferenceAccess.getKey( projectConfiguration, EclipseOutputConfigurationProvider.OUTPUT_OVERRIDE); preferenceStore.setValue(key, true); // // SET GENERATED FILES AS DERIVED key = BuilderPreferenceAccess.getKey( projectConfiguration, EclipseOutputConfigurationProvider.OUTPUT_DERIVED); preferenceStore.setValue(key, true); // // CLEAN THE GENERATED FILES key = BuilderPreferenceAccess.getKey( projectConfiguration, EclipseOutputConfigurationProvider.OUTPUT_CLEANUP_DERIVED); preferenceStore.setValue(key, true); // // CLEAN THE OUTPUT DIRECTORY key = BuilderPreferenceAccess.getKey( projectConfiguration, EclipseOutputConfigurationProvider.OUTPUT_CLEAN_DIRECTORY); preferenceStore.setValue(key, true); } }
java
public static void setSpecificSARLConfigurationFor( IProject project, IPath outputPath) { final IPreferenceStore preferenceStore = getSARLPreferencesFor(project); // Force to use a specific configuration for the SARL preferenceStore.setValue(IS_PROJECT_SPECIFIC, true); // Loop on the Xtext configurations embedded in the SARL compiler. String key; for (final OutputConfiguration projectConfiguration : getXtextConfigurationsFor(project)) { // // OUTPUT PATH key = BuilderPreferenceAccess.getKey( projectConfiguration, EclipseOutputConfigurationProvider.OUTPUT_DIRECTORY); preferenceStore.setValue(key, outputPath.toOSString()); // // CREATE THE OUTPUT DIRECTORY key = BuilderPreferenceAccess.getKey( projectConfiguration, EclipseOutputConfigurationProvider.OUTPUT_CREATE_DIRECTORY); preferenceStore.setValue(key, true); // // OVERWRITE THE EXISTING FILES key = BuilderPreferenceAccess.getKey( projectConfiguration, EclipseOutputConfigurationProvider.OUTPUT_OVERRIDE); preferenceStore.setValue(key, true); // // SET GENERATED FILES AS DERIVED key = BuilderPreferenceAccess.getKey( projectConfiguration, EclipseOutputConfigurationProvider.OUTPUT_DERIVED); preferenceStore.setValue(key, true); // // CLEAN THE GENERATED FILES key = BuilderPreferenceAccess.getKey( projectConfiguration, EclipseOutputConfigurationProvider.OUTPUT_CLEANUP_DERIVED); preferenceStore.setValue(key, true); // // CLEAN THE OUTPUT DIRECTORY key = BuilderPreferenceAccess.getKey( projectConfiguration, EclipseOutputConfigurationProvider.OUTPUT_CLEAN_DIRECTORY); preferenceStore.setValue(key, true); } }
[ "public", "static", "void", "setSpecificSARLConfigurationFor", "(", "IProject", "project", ",", "IPath", "outputPath", ")", "{", "final", "IPreferenceStore", "preferenceStore", "=", "getSARLPreferencesFor", "(", "project", ")", ";", "// Force to use a specific configuration...
Configure the given project for using a specific configuration related to SARL. @param project the project. @param outputPath the path where SARL compiler is generating the Java code.
[ "Configure", "the", "given", "project", "for", "using", "a", "specific", "configuration", "related", "to", "SARL", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/preferences/SARLPreferences.java#L106-L158
train
sarl/sarl
main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/preferences/SARLPreferences.java
SARLPreferences.getGlobalSARLOutputPath
public static IPath getGlobalSARLOutputPath() { final Injector injector = LangActivator.getInstance().getInjector(LangActivator.IO_SARL_LANG_SARL); final IOutputConfigurationProvider configurationProvider = injector.getInstance(IOutputConfigurationProvider.class); final OutputConfiguration config = Iterables.find( configurationProvider.getOutputConfigurations(), it -> Objects.equals(it.getName(), IFileSystemAccess.DEFAULT_OUTPUT)); if (config != null) { final String path = config.getOutputDirectory(); if (!Strings.isNullOrEmpty(path)) { final IPath pathObject = Path.fromOSString(path); if (pathObject != null) { return pathObject; } } } throw new IllegalStateException("No global preferences found for SARL."); //$NON-NLS-1$ }
java
public static IPath getGlobalSARLOutputPath() { final Injector injector = LangActivator.getInstance().getInjector(LangActivator.IO_SARL_LANG_SARL); final IOutputConfigurationProvider configurationProvider = injector.getInstance(IOutputConfigurationProvider.class); final OutputConfiguration config = Iterables.find( configurationProvider.getOutputConfigurations(), it -> Objects.equals(it.getName(), IFileSystemAccess.DEFAULT_OUTPUT)); if (config != null) { final String path = config.getOutputDirectory(); if (!Strings.isNullOrEmpty(path)) { final IPath pathObject = Path.fromOSString(path); if (pathObject != null) { return pathObject; } } } throw new IllegalStateException("No global preferences found for SARL."); //$NON-NLS-1$ }
[ "public", "static", "IPath", "getGlobalSARLOutputPath", "(", ")", "{", "final", "Injector", "injector", "=", "LangActivator", ".", "getInstance", "(", ")", ".", "getInjector", "(", "LangActivator", ".", "IO_SARL_LANG_SARL", ")", ";", "final", "IOutputConfigurationPr...
Replies the SARL output path in the global preferences. @return the output path for SARL compiler in the global preferences.
[ "Replies", "the", "SARL", "output", "path", "in", "the", "global", "preferences", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/preferences/SARLPreferences.java#L190-L207
train
sarl/sarl
main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/BlockExpressionBuilderFragment.java
BlockExpressionBuilderFragment.ensureMemberDeclarationKeyword
protected String ensureMemberDeclarationKeyword(CodeElementExtractor.ElementDescription memberDescription) { final List<String> modifiers = getCodeBuilderConfig().getModifiers().get(memberDescription.getName()); if (modifiers != null && !modifiers.isEmpty()) { return modifiers.get(0); } return null; }
java
protected String ensureMemberDeclarationKeyword(CodeElementExtractor.ElementDescription memberDescription) { final List<String> modifiers = getCodeBuilderConfig().getModifiers().get(memberDescription.getName()); if (modifiers != null && !modifiers.isEmpty()) { return modifiers.get(0); } return null; }
[ "protected", "String", "ensureMemberDeclarationKeyword", "(", "CodeElementExtractor", ".", "ElementDescription", "memberDescription", ")", "{", "final", "List", "<", "String", ">", "modifiers", "=", "getCodeBuilderConfig", "(", ")", ".", "getModifiers", "(", ")", ".",...
Replies a keyword for declaring a member. @param memberDescription the member description. @return the keyword, never <code>null</code> nor an empty string.
[ "Replies", "a", "keyword", "for", "declaring", "a", "member", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/BlockExpressionBuilderFragment.java#L850-L856
train
sarl/sarl
main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/BlockExpressionBuilderFragment.java
BlockExpressionBuilderFragment.getBlockExpressionContextDescription
protected BlockExpressionContextDescription getBlockExpressionContextDescription() { for (final CodeElementExtractor.ElementDescription containerDescription : getCodeElementExtractor().getTopElements( getGrammar(), getCodeBuilderConfig())) { if (!getCodeBuilderConfig().getNoActionBodyTypes().contains(containerDescription.getName())) { final AbstractRule rule = getMemberRule(containerDescription); if (rule != null) { final BlockExpressionContextDescription description = getCodeElementExtractor().visitMemberElements(containerDescription, rule, null, (it, grammarContainer, memberContainer, classifier) -> { final Assignment expressionAssignment = findAssignmentFromTerminalPattern( memberContainer, getExpressionConfig().getBlockExpressionGrammarPattern()); final CodeElementExtractor.ElementDescription memberDescription = it.newElementDescription( classifier.getName(), memberContainer, classifier, XExpression.class); final String keyword = ensureMemberDeclarationKeyword(memberDescription); if (expressionAssignment != null && keyword != null) { return new BlockExpressionContextDescription( containerDescription, memberDescription, ensureContainerKeyword(containerDescription.getGrammarComponent()), keyword, expressionAssignment); } return null; }, null); if (description != null) { return description; } } } } return null; }
java
protected BlockExpressionContextDescription getBlockExpressionContextDescription() { for (final CodeElementExtractor.ElementDescription containerDescription : getCodeElementExtractor().getTopElements( getGrammar(), getCodeBuilderConfig())) { if (!getCodeBuilderConfig().getNoActionBodyTypes().contains(containerDescription.getName())) { final AbstractRule rule = getMemberRule(containerDescription); if (rule != null) { final BlockExpressionContextDescription description = getCodeElementExtractor().visitMemberElements(containerDescription, rule, null, (it, grammarContainer, memberContainer, classifier) -> { final Assignment expressionAssignment = findAssignmentFromTerminalPattern( memberContainer, getExpressionConfig().getBlockExpressionGrammarPattern()); final CodeElementExtractor.ElementDescription memberDescription = it.newElementDescription( classifier.getName(), memberContainer, classifier, XExpression.class); final String keyword = ensureMemberDeclarationKeyword(memberDescription); if (expressionAssignment != null && keyword != null) { return new BlockExpressionContextDescription( containerDescription, memberDescription, ensureContainerKeyword(containerDescription.getGrammarComponent()), keyword, expressionAssignment); } return null; }, null); if (description != null) { return description; } } } } return null; }
[ "protected", "BlockExpressionContextDescription", "getBlockExpressionContextDescription", "(", ")", "{", "for", "(", "final", "CodeElementExtractor", ".", "ElementDescription", "containerDescription", ":", "getCodeElementExtractor", "(", ")", ".", "getTopElements", "(", "getG...
Replies the description of the block expression context. @return the description.
[ "Replies", "the", "description", "of", "the", "block", "expression", "context", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/codebuilder/fragments/BlockExpressionBuilderFragment.java#L862-L897
train
sarl/sarl
sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/bic/internaleventdispatching/AgentInternalEventsDispatcher.java
AgentInternalEventsDispatcher.getRegisteredEventListeners
public <T> int getRegisteredEventListeners(Class<T> type, Collection<? super T> collection) { synchronized (this.behaviorGuardEvaluatorRegistry) { return this.behaviorGuardEvaluatorRegistry.getRegisteredEventListeners(type, collection); } }
java
public <T> int getRegisteredEventListeners(Class<T> type, Collection<? super T> collection) { synchronized (this.behaviorGuardEvaluatorRegistry) { return this.behaviorGuardEvaluatorRegistry.getRegisteredEventListeners(type, collection); } }
[ "public", "<", "T", ">", "int", "getRegisteredEventListeners", "(", "Class", "<", "T", ">", "type", ",", "Collection", "<", "?", "super", "T", ">", "collection", ")", "{", "synchronized", "(", "this", ".", "behaviorGuardEvaluatorRegistry", ")", "{", "return"...
Extract the registered listeners with the given type. @param <T> the type of the listeners. @param type the type of the listeners. @param collection the collection of listeners that is filled by this function. @return the number of listeners added to the collection. @since 0.5
[ "Extract", "the", "registered", "listeners", "with", "the", "given", "type", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/bic/internaleventdispatching/AgentInternalEventsDispatcher.java#L101-L105
train
sarl/sarl
sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/bic/internaleventdispatching/AgentInternalEventsDispatcher.java
AgentInternalEventsDispatcher.executeBehaviorMethodsInParalellWithSynchroAtTheEnd
private void executeBehaviorMethodsInParalellWithSynchroAtTheEnd(Collection<Runnable> behaviorsMethodsToExecute) throws InterruptedException, ExecutionException { final CountDownLatch doneSignal = new CountDownLatch(behaviorsMethodsToExecute.size()); final OutputParameter<Throwable> runException = new OutputParameter<>(); for (final Runnable runnable : behaviorsMethodsToExecute) { this.executor.execute(new JanusRunnable() { @Override public void run() { try { runnable.run(); } catch (EarlyExitException e) { // Ignore this exception } catch (RuntimeException e) { // Catch exception for notifying the caller runException.set(e); // Do the standard behavior too -> logging throw e; } catch (Exception e) { // Catch exception for notifying the caller runException.set(e); // Do the standard behavior too -> logging throw new RuntimeException(e); } finally { doneSignal.countDown(); } } }); } // Wait for all Behaviors runnable to complete before continuing try { doneSignal.await(); } catch (InterruptedException ex) { // This exception occurs when one of the launched task kills the agent before all the // submitted tasks are finished. Keep in mind that killing an agent should kill the // launched tasks. // Example of code that is generating this issue: // // on Initialize { // in (100) [ // killMe // ] // } // // In this example, the killMe is launched before the Initialize code is finished; // and because the Initialize event is fired through the current function, it // causes the InterruptedException. } // Re-throw the run-time exception if (runException.get() != null) { throw new ExecutionException(runException.get()); } }
java
private void executeBehaviorMethodsInParalellWithSynchroAtTheEnd(Collection<Runnable> behaviorsMethodsToExecute) throws InterruptedException, ExecutionException { final CountDownLatch doneSignal = new CountDownLatch(behaviorsMethodsToExecute.size()); final OutputParameter<Throwable> runException = new OutputParameter<>(); for (final Runnable runnable : behaviorsMethodsToExecute) { this.executor.execute(new JanusRunnable() { @Override public void run() { try { runnable.run(); } catch (EarlyExitException e) { // Ignore this exception } catch (RuntimeException e) { // Catch exception for notifying the caller runException.set(e); // Do the standard behavior too -> logging throw e; } catch (Exception e) { // Catch exception for notifying the caller runException.set(e); // Do the standard behavior too -> logging throw new RuntimeException(e); } finally { doneSignal.countDown(); } } }); } // Wait for all Behaviors runnable to complete before continuing try { doneSignal.await(); } catch (InterruptedException ex) { // This exception occurs when one of the launched task kills the agent before all the // submitted tasks are finished. Keep in mind that killing an agent should kill the // launched tasks. // Example of code that is generating this issue: // // on Initialize { // in (100) [ // killMe // ] // } // // In this example, the killMe is launched before the Initialize code is finished; // and because the Initialize event is fired through the current function, it // causes the InterruptedException. } // Re-throw the run-time exception if (runException.get() != null) { throw new ExecutionException(runException.get()); } }
[ "private", "void", "executeBehaviorMethodsInParalellWithSynchroAtTheEnd", "(", "Collection", "<", "Runnable", ">", "behaviorsMethodsToExecute", ")", "throws", "InterruptedException", ",", "ExecutionException", "{", "final", "CountDownLatch", "doneSignal", "=", "new", "CountDo...
Execute every single Behaviors runnable, a dedicated thread will created by the executor local to this class and be used to execute each runnable in parallel, and this method waits until its future has been completed before leaving. <p>This function may fail if one of the called handlers has failed. Errors are logged by the executor service too. @param behaviorsMethodsToExecute the collection of Behaviors runnable that must be executed. @throws InterruptedException - something interrupt the waiting of the event handler terminations. @throws ExecutionException - when the event handlers cannot be called; or when one of the event handler has failed during its run.
[ "Execute", "every", "single", "Behaviors", "runnable", "a", "dedicated", "thread", "will", "created", "by", "the", "executor", "local", "to", "this", "class", "and", "be", "used", "to", "execute", "each", "runnable", "in", "parallel", "and", "this", "method", ...
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/bic/internaleventdispatching/AgentInternalEventsDispatcher.java#L283-L339
train
sarl/sarl
sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/bic/internaleventdispatching/AgentInternalEventsDispatcher.java
AgentInternalEventsDispatcher.executeAsynchronouslyBehaviorMethods
private void executeAsynchronouslyBehaviorMethods(Collection<Runnable> behaviorsMethodsToExecute) { for (final Runnable runnable : behaviorsMethodsToExecute) { this.executor.execute(runnable); } }
java
private void executeAsynchronouslyBehaviorMethods(Collection<Runnable> behaviorsMethodsToExecute) { for (final Runnable runnable : behaviorsMethodsToExecute) { this.executor.execute(runnable); } }
[ "private", "void", "executeAsynchronouslyBehaviorMethods", "(", "Collection", "<", "Runnable", ">", "behaviorsMethodsToExecute", ")", "{", "for", "(", "final", "Runnable", "runnable", ":", "behaviorsMethodsToExecute", ")", "{", "this", ".", "executor", ".", "execute",...
Execute every single Behaviors runnable, a dedicated thread will created by the executor local to this class and be used to execute each runnable in parallel. <p>This function never fails. Errors in the event handlers are logged by the executor service. @param behaviorsMethodsToExecute the collection of Behaviors runnable that must be executed.
[ "Execute", "every", "single", "Behaviors", "runnable", "a", "dedicated", "thread", "will", "created", "by", "the", "executor", "local", "to", "this", "class", "and", "be", "used", "to", "execute", "each", "runnable", "in", "parallel", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/sre/io.janusproject/io.janusproject.plugin/src/io/janusproject/kernel/bic/internaleventdispatching/AgentInternalEventsDispatcher.java#L349-L353
train
sarl/sarl
main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/dialog/SARLRuntimeEnvironmentTab.java
SARLRuntimeEnvironmentTab.selectSREFromConfig
protected void selectSREFromConfig(ILaunchConfiguration config) { final boolean notify = this.sreBlock.getNotify(); final boolean changed; try { this.sreBlock.setNotify(false); if (this.accessor.getUseSystemSREFlag(config)) { changed = this.sreBlock.selectSystemWideSRE(); } else if (this.accessor.getUseProjectSREFlag(config)) { changed = this.sreBlock.selectProjectSRE(); } else { final String sreId = this.accessor.getSREId(config); final ISREInstall sre = SARLRuntime.getSREFromId(Strings.nullToEmpty(sreId)); changed = this.sreBlock.selectSpecificSRE(sre); } } finally { this.sreBlock.setNotify(notify); } if (changed) { updateLaunchConfigurationDialog(); } }
java
protected void selectSREFromConfig(ILaunchConfiguration config) { final boolean notify = this.sreBlock.getNotify(); final boolean changed; try { this.sreBlock.setNotify(false); if (this.accessor.getUseSystemSREFlag(config)) { changed = this.sreBlock.selectSystemWideSRE(); } else if (this.accessor.getUseProjectSREFlag(config)) { changed = this.sreBlock.selectProjectSRE(); } else { final String sreId = this.accessor.getSREId(config); final ISREInstall sre = SARLRuntime.getSREFromId(Strings.nullToEmpty(sreId)); changed = this.sreBlock.selectSpecificSRE(sre); } } finally { this.sreBlock.setNotify(notify); } if (changed) { updateLaunchConfigurationDialog(); } }
[ "protected", "void", "selectSREFromConfig", "(", "ILaunchConfiguration", "config", ")", "{", "final", "boolean", "notify", "=", "this", ".", "sreBlock", ".", "getNotify", "(", ")", ";", "final", "boolean", "changed", ";", "try", "{", "this", ".", "sreBlock", ...
Loads the SARL runtime environment from the launch configuration's preference store. @param config the config to load the runtime environment from
[ "Loads", "the", "SARL", "runtime", "environment", "from", "the", "launch", "configuration", "s", "preference", "store", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/dialog/SARLRuntimeEnvironmentTab.java#L172-L192
train
sarl/sarl
main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/dialog/SARLRuntimeEnvironmentTab.java
SARLRuntimeEnvironmentTab.isValidJREVersion
protected boolean isValidJREVersion(ILaunchConfiguration config) { final IVMInstall install = this.fJREBlock.getJRE(); if (install instanceof IVMInstall2) { final String version = ((IVMInstall2) install).getJavaVersion(); if (version == null) { setErrorMessage(MessageFormat.format( Messages.RuntimeEnvironmentTab_3, install.getName())); return false; } if (!Utils.isCompatibleJREVersion(version)) { setErrorMessage(MessageFormat.format( Messages.RuntimeEnvironmentTab_4, install.getName(), version, SARLVersion.MINIMAL_JDK_VERSION, SARLVersion.MAXIMAL_JDK_VERSION)); return false; } } return true; }
java
protected boolean isValidJREVersion(ILaunchConfiguration config) { final IVMInstall install = this.fJREBlock.getJRE(); if (install instanceof IVMInstall2) { final String version = ((IVMInstall2) install).getJavaVersion(); if (version == null) { setErrorMessage(MessageFormat.format( Messages.RuntimeEnvironmentTab_3, install.getName())); return false; } if (!Utils.isCompatibleJREVersion(version)) { setErrorMessage(MessageFormat.format( Messages.RuntimeEnvironmentTab_4, install.getName(), version, SARLVersion.MINIMAL_JDK_VERSION, SARLVersion.MAXIMAL_JDK_VERSION)); return false; } } return true; }
[ "protected", "boolean", "isValidJREVersion", "(", "ILaunchConfiguration", "config", ")", "{", "final", "IVMInstall", "install", "=", "this", ".", "fJREBlock", ".", "getJRE", "(", ")", ";", "if", "(", "install", "instanceof", "IVMInstall2", ")", "{", "final", "...
Replies if the selected configuration has a valid version for a SARL application. @param config the configuration. @return <code>true</code> if the JRE is compatible with SARL.
[ "Replies", "if", "the", "selected", "configuration", "has", "a", "valid", "version", "for", "a", "SARL", "application", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/dialog/SARLRuntimeEnvironmentTab.java#L250-L270
train
sarl/sarl
main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLDescriptionLabelProvider.java
SARLDescriptionLabelProvider.image
public ImageDescriptor image(SarlAgent agent) { final JvmDeclaredType jvmElement = this.jvmModelAssociations.getInferredType(agent); return this.images.forAgent( agent.getVisibility(), this.adornments.get(jvmElement)); }
java
public ImageDescriptor image(SarlAgent agent) { final JvmDeclaredType jvmElement = this.jvmModelAssociations.getInferredType(agent); return this.images.forAgent( agent.getVisibility(), this.adornments.get(jvmElement)); }
[ "public", "ImageDescriptor", "image", "(", "SarlAgent", "agent", ")", "{", "final", "JvmDeclaredType", "jvmElement", "=", "this", ".", "jvmModelAssociations", ".", "getInferredType", "(", "agent", ")", ";", "return", "this", ".", "images", ".", "forAgent", "(", ...
Replies the image for an agent. @param agent describes the agent. @return the image descriptor.
[ "Replies", "the", "image", "for", "an", "agent", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLDescriptionLabelProvider.java#L93-L98
train
sarl/sarl
main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLDescriptionLabelProvider.java
SARLDescriptionLabelProvider.image
public ImageDescriptor image(SarlBehavior behavior) { final JvmDeclaredType jvmElement = this.jvmModelAssociations.getInferredType(behavior); return this.images.forBehavior( behavior.getVisibility(), this.adornments.get(jvmElement)); }
java
public ImageDescriptor image(SarlBehavior behavior) { final JvmDeclaredType jvmElement = this.jvmModelAssociations.getInferredType(behavior); return this.images.forBehavior( behavior.getVisibility(), this.adornments.get(jvmElement)); }
[ "public", "ImageDescriptor", "image", "(", "SarlBehavior", "behavior", ")", "{", "final", "JvmDeclaredType", "jvmElement", "=", "this", ".", "jvmModelAssociations", ".", "getInferredType", "(", "behavior", ")", ";", "return", "this", ".", "images", ".", "forBehavi...
Replies the image for a behavior. @param behavior describes the behavior. @return the image descriptor.
[ "Replies", "the", "image", "for", "a", "behavior", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLDescriptionLabelProvider.java#L105-L110
train
sarl/sarl
main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLDescriptionLabelProvider.java
SARLDescriptionLabelProvider.image
public ImageDescriptor image(SarlCapacity capacity) { final JvmDeclaredType jvmElement = this.jvmModelAssociations.getInferredType(capacity); return this.images.forCapacity( capacity.getVisibility(), this.adornments.get(jvmElement)); }
java
public ImageDescriptor image(SarlCapacity capacity) { final JvmDeclaredType jvmElement = this.jvmModelAssociations.getInferredType(capacity); return this.images.forCapacity( capacity.getVisibility(), this.adornments.get(jvmElement)); }
[ "public", "ImageDescriptor", "image", "(", "SarlCapacity", "capacity", ")", "{", "final", "JvmDeclaredType", "jvmElement", "=", "this", ".", "jvmModelAssociations", ".", "getInferredType", "(", "capacity", ")", ";", "return", "this", ".", "images", ".", "forCapaci...
Replies the image for a capacity. @param capacity describes the capacity. @return the image descriptor.
[ "Replies", "the", "image", "for", "a", "capacity", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLDescriptionLabelProvider.java#L117-L122
train
sarl/sarl
main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLDescriptionLabelProvider.java
SARLDescriptionLabelProvider.image
public ImageDescriptor image(SarlSkill skill) { final JvmDeclaredType jvmElement = this.jvmModelAssociations.getInferredType(skill); return this.images.forSkill( skill.getVisibility(), this.adornments.get(jvmElement)); }
java
public ImageDescriptor image(SarlSkill skill) { final JvmDeclaredType jvmElement = this.jvmModelAssociations.getInferredType(skill); return this.images.forSkill( skill.getVisibility(), this.adornments.get(jvmElement)); }
[ "public", "ImageDescriptor", "image", "(", "SarlSkill", "skill", ")", "{", "final", "JvmDeclaredType", "jvmElement", "=", "this", ".", "jvmModelAssociations", ".", "getInferredType", "(", "skill", ")", ";", "return", "this", ".", "images", ".", "forSkill", "(", ...
Replies the image for a skill. @param skill describes the skill. @return the image descriptor.
[ "Replies", "the", "image", "for", "a", "skill", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLDescriptionLabelProvider.java#L129-L134
train
sarl/sarl
main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLDescriptionLabelProvider.java
SARLDescriptionLabelProvider.image
public ImageDescriptor image(SarlEvent event) { final JvmDeclaredType jvmElement = this.jvmModelAssociations.getInferredType(event); return this.images.forEvent( event.getVisibility(), this.adornments.get(jvmElement)); }
java
public ImageDescriptor image(SarlEvent event) { final JvmDeclaredType jvmElement = this.jvmModelAssociations.getInferredType(event); return this.images.forEvent( event.getVisibility(), this.adornments.get(jvmElement)); }
[ "public", "ImageDescriptor", "image", "(", "SarlEvent", "event", ")", "{", "final", "JvmDeclaredType", "jvmElement", "=", "this", ".", "jvmModelAssociations", ".", "getInferredType", "(", "event", ")", ";", "return", "this", ".", "images", ".", "forEvent", "(", ...
Replies the image for an event. @param event describes the event. @return the image descriptor.
[ "Replies", "the", "image", "for", "an", "event", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLDescriptionLabelProvider.java#L141-L146
train
sarl/sarl
main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLDescriptionLabelProvider.java
SARLDescriptionLabelProvider.image
public ImageDescriptor image(SarlAction action) { final JvmOperation jvmElement = this.jvmModelAssociations.getDirectlyInferredOperation(action); return this.images.forOperation( action.getVisibility(), this.adornments.get(jvmElement)); }
java
public ImageDescriptor image(SarlAction action) { final JvmOperation jvmElement = this.jvmModelAssociations.getDirectlyInferredOperation(action); return this.images.forOperation( action.getVisibility(), this.adornments.get(jvmElement)); }
[ "public", "ImageDescriptor", "image", "(", "SarlAction", "action", ")", "{", "final", "JvmOperation", "jvmElement", "=", "this", ".", "jvmModelAssociations", ".", "getDirectlyInferredOperation", "(", "action", ")", ";", "return", "this", ".", "images", ".", "forOp...
Replies the image for an action. @param action describes the action. @return the image descriptor.
[ "Replies", "the", "image", "for", "an", "action", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLDescriptionLabelProvider.java#L153-L158
train
sarl/sarl
main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLDescriptionLabelProvider.java
SARLDescriptionLabelProvider.image
public ImageDescriptor image(SarlField attribute) { return this.images.forField( attribute.getVisibility(), this.adornments.get(this.jvmModelAssociations.getJvmField(attribute))); }
java
public ImageDescriptor image(SarlField attribute) { return this.images.forField( attribute.getVisibility(), this.adornments.get(this.jvmModelAssociations.getJvmField(attribute))); }
[ "public", "ImageDescriptor", "image", "(", "SarlField", "attribute", ")", "{", "return", "this", ".", "images", ".", "forField", "(", "attribute", ".", "getVisibility", "(", ")", ",", "this", ".", "adornments", ".", "get", "(", "this", ".", "jvmModelAssociat...
Replies the image for an attribute. @param attribute describes the attribute. @return the image descriptor.
[ "Replies", "the", "image", "for", "an", "attribute", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLDescriptionLabelProvider.java#L192-L196
train
sarl/sarl
main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLDescriptionLabelProvider.java
SARLDescriptionLabelProvider.image
public ImageDescriptor image(SarlConstructor constructor) { if (constructor.isStatic()) { return this.images.forStaticConstructor(); } return this.images.forConstructor( constructor.getVisibility(), this.adornments.get(this.jvmModelAssociations.getInferredConstructor(constructor))); }
java
public ImageDescriptor image(SarlConstructor constructor) { if (constructor.isStatic()) { return this.images.forStaticConstructor(); } return this.images.forConstructor( constructor.getVisibility(), this.adornments.get(this.jvmModelAssociations.getInferredConstructor(constructor))); }
[ "public", "ImageDescriptor", "image", "(", "SarlConstructor", "constructor", ")", "{", "if", "(", "constructor", ".", "isStatic", "(", ")", ")", "{", "return", "this", ".", "images", ".", "forStaticConstructor", "(", ")", ";", "}", "return", "this", ".", "...
Replies the image for a constructor. @param constructor describes the constructor. @return the image descriptor.
[ "Replies", "the", "image", "for", "a", "constructor", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/labeling/SARLDescriptionLabelProvider.java#L203-L210
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java
SarlBatchCompiler.newDefaultJavaBatchCompiler
public static IJavaBatchCompiler newDefaultJavaBatchCompiler() { try { synchronized (SarlBatchCompiler.class) { if (defaultJavaBatchCompiler == null) { final ImplementedBy annotation = IJavaBatchCompiler.class.getAnnotation(ImplementedBy.class); assert annotation != null; final Class<?> type = annotation.value(); assert type != null; defaultJavaBatchCompiler = type.asSubclass(IJavaBatchCompiler.class); } return defaultJavaBatchCompiler.newInstance(); } } catch (Exception exception) { throw new RuntimeException(exception); } }
java
public static IJavaBatchCompiler newDefaultJavaBatchCompiler() { try { synchronized (SarlBatchCompiler.class) { if (defaultJavaBatchCompiler == null) { final ImplementedBy annotation = IJavaBatchCompiler.class.getAnnotation(ImplementedBy.class); assert annotation != null; final Class<?> type = annotation.value(); assert type != null; defaultJavaBatchCompiler = type.asSubclass(IJavaBatchCompiler.class); } return defaultJavaBatchCompiler.newInstance(); } } catch (Exception exception) { throw new RuntimeException(exception); } }
[ "public", "static", "IJavaBatchCompiler", "newDefaultJavaBatchCompiler", "(", ")", "{", "try", "{", "synchronized", "(", "SarlBatchCompiler", ".", "class", ")", "{", "if", "(", "defaultJavaBatchCompiler", "==", "null", ")", "{", "final", "ImplementedBy", "annotation...
Create a default Java batch compiler, without injection. @return the Java batch compiler. @since 0.8
[ "Create", "a", "default", "Java", "batch", "compiler", "without", "injection", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L282-L297
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java
SarlBatchCompiler.notifiesIssueMessageListeners
private void notifiesIssueMessageListeners(Issue issue, org.eclipse.emf.common.util.URI uri, String message) { for (final IssueMessageListener listener : this.messageListeners) { listener.onIssue(issue, uri, message); } }
java
private void notifiesIssueMessageListeners(Issue issue, org.eclipse.emf.common.util.URI uri, String message) { for (final IssueMessageListener listener : this.messageListeners) { listener.onIssue(issue, uri, message); } }
[ "private", "void", "notifiesIssueMessageListeners", "(", "Issue", "issue", ",", "org", ".", "eclipse", ".", "emf", ".", "common", ".", "util", ".", "URI", "uri", ",", "String", "message", ")", "{", "for", "(", "final", "IssueMessageListener", "listener", ":"...
Replies the message for the given issue. @param issue the issue. @param uri URI to the problem. @param message the formatted message. @since 0.6
[ "Replies", "the", "message", "for", "the", "given", "issue", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L449-L453
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java
SarlBatchCompiler.setLogger
public void setLogger(Logger logger) { this.logger = logger == null ? LoggerFactory.getLogger(getClass()) : logger; }
java
public void setLogger(Logger logger) { this.logger = logger == null ? LoggerFactory.getLogger(getClass()) : logger; }
[ "public", "void", "setLogger", "(", "Logger", "logger", ")", "{", "this", ".", "logger", "=", "logger", "==", "null", "?", "LoggerFactory", ".", "getLogger", "(", "getClass", "(", ")", ")", ":", "logger", ";", "}" ]
Set the logger. @param logger the logger.
[ "Set", "the", "logger", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L496-L498
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java
SarlBatchCompiler.setBaseURI
public void setBaseURI(org.eclipse.emf.common.util.URI basePath) { this.baseUri = basePath; }
java
public void setBaseURI(org.eclipse.emf.common.util.URI basePath) { this.baseUri = basePath; }
[ "public", "void", "setBaseURI", "(", "org", ".", "eclipse", ".", "emf", ".", "common", ".", "util", ".", "URI", "basePath", ")", "{", "this", ".", "baseUri", "=", "basePath", ";", "}" ]
Change the base URI. @param basePath the base path.
[ "Change", "the", "base", "URI", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L638-L640
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java
SarlBatchCompiler.getBootClassPath
@Pure public List<File> getBootClassPath() { if (this.bootClasspath == null) { return Collections.emptyList(); } return Collections.unmodifiableList(this.bootClasspath); }
java
@Pure public List<File> getBootClassPath() { if (this.bootClasspath == null) { return Collections.emptyList(); } return Collections.unmodifiableList(this.bootClasspath); }
[ "@", "Pure", "public", "List", "<", "File", ">", "getBootClassPath", "(", ")", "{", "if", "(", "this", ".", "bootClasspath", "==", "null", ")", "{", "return", "Collections", ".", "emptyList", "(", ")", ";", "}", "return", "Collections", ".", "unmodifiabl...
Replies the boot classpath. This option is only supported on JDK 8 and older and will be ignored when source level is 9 or newer. @return the boot classpath. @see "https://www.oracle.com/technetwork/java/javase/9-relnote-issues-3704069.html"
[ "Replies", "the", "boot", "classpath", ".", "This", "option", "is", "only", "supported", "on", "JDK", "8", "and", "older", "and", "will", "be", "ignored", "when", "source", "level", "is", "9", "or", "newer", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L733-L739
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java
SarlBatchCompiler.setClassPath
public void setClassPath(String classpath) { this.classpath = new ArrayList<>(); for (final String path : Strings.split(classpath, Pattern.quote(File.pathSeparator))) { this.classpath.add(normalizeFile(path)); } }
java
public void setClassPath(String classpath) { this.classpath = new ArrayList<>(); for (final String path : Strings.split(classpath, Pattern.quote(File.pathSeparator))) { this.classpath.add(normalizeFile(path)); } }
[ "public", "void", "setClassPath", "(", "String", "classpath", ")", "{", "this", ".", "classpath", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "final", "String", "path", ":", "Strings", ".", "split", "(", "classpath", ",", "Pattern", ".", ...
Change the classpath. <p>The classpath is a list the names of folders or jar files that are separated by {@link File#pathSeparator}. @param classpath the new classpath.
[ "Change", "the", "classpath", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L747-L752
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java
SarlBatchCompiler.getClassPath
@Pure public List<File> getClassPath() { if (this.classpath == null) { return Collections.emptyList(); } return Collections.unmodifiableList(this.classpath); }
java
@Pure public List<File> getClassPath() { if (this.classpath == null) { return Collections.emptyList(); } return Collections.unmodifiableList(this.classpath); }
[ "@", "Pure", "public", "List", "<", "File", ">", "getClassPath", "(", ")", "{", "if", "(", "this", ".", "classpath", "==", "null", ")", "{", "return", "Collections", ".", "emptyList", "(", ")", ";", "}", "return", "Collections", ".", "unmodifiableList", ...
Replies the classpath. @return the classpath.
[ "Replies", "the", "classpath", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L766-L772
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java
SarlBatchCompiler.createTempDirectory
@SuppressWarnings("static-method") protected File createTempDirectory() { final File tmpPath = new File(System.getProperty("java.io.tmpdir")); //$NON-NLS-1$ int i = 0; File tmp = new File(tmpPath, "sarlc" + i); //$NON-NLS-1$ while (tmp.exists()) { ++i; tmp = new File(tmpPath, "sarlc" + i); //$NON-NLS-1$ } return tmp; }
java
@SuppressWarnings("static-method") protected File createTempDirectory() { final File tmpPath = new File(System.getProperty("java.io.tmpdir")); //$NON-NLS-1$ int i = 0; File tmp = new File(tmpPath, "sarlc" + i); //$NON-NLS-1$ while (tmp.exists()) { ++i; tmp = new File(tmpPath, "sarlc" + i); //$NON-NLS-1$ } return tmp; }
[ "@", "SuppressWarnings", "(", "\"static-method\"", ")", "protected", "File", "createTempDirectory", "(", ")", "{", "final", "File", "tmpPath", "=", "new", "File", "(", "System", ".", "getProperty", "(", "\"java.io.tmpdir\"", ")", ")", ";", "//$NON-NLS-1$", "int"...
Create the temp directory that should be used by the compiler. @return the temp directory, never {@code null}.
[ "Create", "the", "temp", "directory", "that", "should", "be", "used", "by", "the", "compiler", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L806-L816
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java
SarlBatchCompiler.setJavaSourceVersion
public void setJavaSourceVersion(String version) { final JavaVersion javaVersion = JavaVersion.fromQualifier(version); if (javaVersion == null) { final List<String> qualifiers = new ArrayList<>(); for (final JavaVersion vers : JavaVersion.values()) { qualifiers.addAll(vers.getAllQualifiers()); } throw new RuntimeException(MessageFormat.format( Messages.SarlBatchCompiler_0, version, Joiner.on(Messages.SarlBatchCompiler_1).join(qualifiers))); } getGeneratorConfig().setJavaSourceVersion(javaVersion); }
java
public void setJavaSourceVersion(String version) { final JavaVersion javaVersion = JavaVersion.fromQualifier(version); if (javaVersion == null) { final List<String> qualifiers = new ArrayList<>(); for (final JavaVersion vers : JavaVersion.values()) { qualifiers.addAll(vers.getAllQualifiers()); } throw new RuntimeException(MessageFormat.format( Messages.SarlBatchCompiler_0, version, Joiner.on(Messages.SarlBatchCompiler_1).join(qualifiers))); } getGeneratorConfig().setJavaSourceVersion(javaVersion); }
[ "public", "void", "setJavaSourceVersion", "(", "String", "version", ")", "{", "final", "JavaVersion", "javaVersion", "=", "JavaVersion", ".", "fromQualifier", "(", "version", ")", ";", "if", "(", "javaVersion", "==", "null", ")", "{", "final", "List", "<", "...
Change the version of the Java source to be used for the generated Java files. @param version the Java version.
[ "Change", "the", "version", "of", "the", "Java", "source", "to", "be", "used", "for", "the", "generated", "Java", "files", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L878-L890
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java
SarlBatchCompiler.setSourcePath
public void setSourcePath(String sourcePath) { this.sourcePath = new ArrayList<>(); for (final String path : Strings.split(sourcePath, Pattern.quote(File.pathSeparator))) { this.sourcePath.add(normalizeFile(path)); } }
java
public void setSourcePath(String sourcePath) { this.sourcePath = new ArrayList<>(); for (final String path : Strings.split(sourcePath, Pattern.quote(File.pathSeparator))) { this.sourcePath.add(normalizeFile(path)); } }
[ "public", "void", "setSourcePath", "(", "String", "sourcePath", ")", "{", "this", ".", "sourcePath", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "final", "String", "path", ":", "Strings", ".", "split", "(", "sourcePath", ",", "Pattern", "."...
Change the source path. <p>The source path is a list the names of folders that are separated by {@link File#pathSeparator}. @param sourcePath the new source path.
[ "Change", "the", "source", "path", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L1119-L1124
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java
SarlBatchCompiler.addSourcePath
public void addSourcePath(File sourcePath) { if (this.sourcePath == null) { this.sourcePath = new ArrayList<>(); } this.sourcePath.add(sourcePath); }
java
public void addSourcePath(File sourcePath) { if (this.sourcePath == null) { this.sourcePath = new ArrayList<>(); } this.sourcePath.add(sourcePath); }
[ "public", "void", "addSourcePath", "(", "File", "sourcePath", ")", "{", "if", "(", "this", ".", "sourcePath", "==", "null", ")", "{", "this", ".", "sourcePath", "=", "new", "ArrayList", "<>", "(", ")", ";", "}", "this", ".", "sourcePath", ".", "add", ...
Add a folder to the source path. @param sourcePath the new source path.
[ "Add", "a", "folder", "to", "the", "source", "path", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L1148-L1153
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java
SarlBatchCompiler.getSourcePaths
@Pure public List<File> getSourcePaths() { if (this.sourcePath == null) { return Collections.emptyList(); } return Collections.unmodifiableList(this.sourcePath); }
java
@Pure public List<File> getSourcePaths() { if (this.sourcePath == null) { return Collections.emptyList(); } return Collections.unmodifiableList(this.sourcePath); }
[ "@", "Pure", "public", "List", "<", "File", ">", "getSourcePaths", "(", ")", "{", "if", "(", "this", ".", "sourcePath", "==", "null", ")", "{", "return", "Collections", ".", "emptyList", "(", ")", ";", "}", "return", "Collections", ".", "unmodifiableList...
Replies the source path. @return the source path.
[ "Replies", "the", "source", "path", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L1159-L1165
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java
SarlBatchCompiler.overrideXtextInternalLoggers
protected void overrideXtextInternalLoggers() { final Logger logger = getLogger(); final org.apache.log4j.spi.LoggerFactory factory = new InternalXtextLoggerFactory(logger); final org.apache.log4j.Logger internalLogger = org.apache.log4j.Logger.getLogger( MessageFormat.format(Messages.SarlBatchCompiler_40, logger.getName()), factory); setStaticField(BatchLinkableResourceStorageWritable.class, "LOG", internalLogger); //$NON-NLS-1$ setStaticField(BatchLinkableResource.class, "log", internalLogger); //$NON-NLS-1$ setStaticField(ProcessorInstanceForJvmTypeProvider.class, "logger", internalLogger); //$NON-NLS-1$ }
java
protected void overrideXtextInternalLoggers() { final Logger logger = getLogger(); final org.apache.log4j.spi.LoggerFactory factory = new InternalXtextLoggerFactory(logger); final org.apache.log4j.Logger internalLogger = org.apache.log4j.Logger.getLogger( MessageFormat.format(Messages.SarlBatchCompiler_40, logger.getName()), factory); setStaticField(BatchLinkableResourceStorageWritable.class, "LOG", internalLogger); //$NON-NLS-1$ setStaticField(BatchLinkableResource.class, "log", internalLogger); //$NON-NLS-1$ setStaticField(ProcessorInstanceForJvmTypeProvider.class, "logger", internalLogger); //$NON-NLS-1$ }
[ "protected", "void", "overrideXtextInternalLoggers", "(", ")", "{", "final", "Logger", "logger", "=", "getLogger", "(", ")", ";", "final", "org", ".", "apache", ".", "log4j", ".", "spi", ".", "LoggerFactory", "factory", "=", "new", "InternalXtextLoggerFactory", ...
Change the loggers that are internally used by Xtext.
[ "Change", "the", "loggers", "that", "are", "internally", "used", "by", "Xtext", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L1371-L1379
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java
SarlBatchCompiler.createIssueMessage
protected String createIssueMessage(Issue issue) { final IssueMessageFormatter formatter = getIssueMessageFormatter(); final org.eclipse.emf.common.util.URI uriToProblem = issue.getUriToProblem(); if (formatter != null) { final String message = formatter.format(issue, uriToProblem); if (message != null) { return message; } } if (uriToProblem != null) { final org.eclipse.emf.common.util.URI resourceUri = uriToProblem.trimFragment(); return MessageFormat.format(Messages.SarlBatchCompiler_4, issue.getSeverity(), resourceUri.lastSegment(), resourceUri.isFile() ? resourceUri.toFileString() : "", //$NON-NLS-1$ issue.getLineNumber(), issue.getColumn(), issue.getCode(), issue.getMessage()); } return MessageFormat.format(Messages.SarlBatchCompiler_5, issue.getSeverity(), issue.getLineNumber(), issue.getColumn(), issue.getCode(), issue.getMessage()); }
java
protected String createIssueMessage(Issue issue) { final IssueMessageFormatter formatter = getIssueMessageFormatter(); final org.eclipse.emf.common.util.URI uriToProblem = issue.getUriToProblem(); if (formatter != null) { final String message = formatter.format(issue, uriToProblem); if (message != null) { return message; } } if (uriToProblem != null) { final org.eclipse.emf.common.util.URI resourceUri = uriToProblem.trimFragment(); return MessageFormat.format(Messages.SarlBatchCompiler_4, issue.getSeverity(), resourceUri.lastSegment(), resourceUri.isFile() ? resourceUri.toFileString() : "", //$NON-NLS-1$ issue.getLineNumber(), issue.getColumn(), issue.getCode(), issue.getMessage()); } return MessageFormat.format(Messages.SarlBatchCompiler_5, issue.getSeverity(), issue.getLineNumber(), issue.getColumn(), issue.getCode(), issue.getMessage()); }
[ "protected", "String", "createIssueMessage", "(", "Issue", "issue", ")", "{", "final", "IssueMessageFormatter", "formatter", "=", "getIssueMessageFormatter", "(", ")", ";", "final", "org", ".", "eclipse", ".", "emf", ".", "common", ".", "util", ".", "URI", "ur...
Create a message for the issue. @param issue the issue. @return the message.
[ "Create", "a", "message", "for", "the", "issue", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L1401-L1419
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java
SarlBatchCompiler.reportCompilationIssues
protected boolean reportCompilationIssues(Iterable<Issue> issues) { boolean hasError = false; for (final Issue issue : issues) { final String issueMessage = createIssueMessage(issue); switch (issue.getSeverity()) { case ERROR: hasError = true; getLogger().error(issueMessage); break; case WARNING: getLogger().warn(issueMessage); break; case INFO: getLogger().info(issueMessage); break; case IGNORE: default: break; } notifiesIssueMessageListeners(issue, issue.getUriToProblem(), issueMessage); } return hasError; }
java
protected boolean reportCompilationIssues(Iterable<Issue> issues) { boolean hasError = false; for (final Issue issue : issues) { final String issueMessage = createIssueMessage(issue); switch (issue.getSeverity()) { case ERROR: hasError = true; getLogger().error(issueMessage); break; case WARNING: getLogger().warn(issueMessage); break; case INFO: getLogger().info(issueMessage); break; case IGNORE: default: break; } notifiesIssueMessageListeners(issue, issue.getUriToProblem(), issueMessage); } return hasError; }
[ "protected", "boolean", "reportCompilationIssues", "(", "Iterable", "<", "Issue", ">", "issues", ")", "{", "boolean", "hasError", "=", "false", ";", "for", "(", "final", "Issue", "issue", ":", "issues", ")", "{", "final", "String", "issueMessage", "=", "crea...
Output the given issues that result from the compilation of the SARL code. @param issues the issues to report. @return {@code true} if at least one error was reported, {@code false} if no error was reported.
[ "Output", "the", "given", "issues", "that", "result", "from", "the", "compilation", "of", "the", "SARL", "code", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L1427-L1449
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java
SarlBatchCompiler.reportInternalError
protected void reportInternalError(String message, Object... parameters) { getLogger().error(message, parameters); if (getReportInternalProblemsAsIssues()) { final org.eclipse.emf.common.util.URI uri = null; final Issue.IssueImpl issue = new Issue.IssueImpl(); issue.setCode(INTERNAL_ERROR_CODE); issue.setMessage(message); issue.setUriToProblem(uri); issue.setSeverity(Severity.ERROR); notifiesIssueMessageListeners(issue, uri, message); } }
java
protected void reportInternalError(String message, Object... parameters) { getLogger().error(message, parameters); if (getReportInternalProblemsAsIssues()) { final org.eclipse.emf.common.util.URI uri = null; final Issue.IssueImpl issue = new Issue.IssueImpl(); issue.setCode(INTERNAL_ERROR_CODE); issue.setMessage(message); issue.setUriToProblem(uri); issue.setSeverity(Severity.ERROR); notifiesIssueMessageListeners(issue, uri, message); } }
[ "protected", "void", "reportInternalError", "(", "String", "message", ",", "Object", "...", "parameters", ")", "{", "getLogger", "(", ")", ".", "error", "(", "message", ",", "parameters", ")", ";", "if", "(", "getReportInternalProblemsAsIssues", "(", ")", ")",...
Reports the given error message. @param message the warning message. @param parameters the values of the parameters that must be dynamically replaced within the message text. @since 0.8
[ "Reports", "the", "given", "error", "message", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L1513-L1524
train
sarl/sarl
main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java
SarlBatchCompiler.generateJavaFiles
protected void generateJavaFiles(Iterable<Resource> validatedResources, IProgressMonitor progress) { assert progress != null; progress.subTask(Messages.SarlBatchCompiler_49); getLogger().info(Messages.SarlBatchCompiler_28, getOutputPath()); final JavaIoFileSystemAccess javaIoFileSystemAccess = this.javaIoFileSystemAccessProvider.get(); javaIoFileSystemAccess.setOutputConfigurations(this.outputConfigurations); // The function configureWorkspace should set the output paths with absolute paths. //javaIoFileSystemAccess.setOutputPath(getOutputPath().getAbsolutePath()); javaIoFileSystemAccess.setWriteTrace(isWriteTraceFiles()); if (progress.isCanceled()) { return; } final GeneratorContext context = new GeneratorContext(); context.setCancelIndicator(() -> progress.isCanceled()); for (final Resource resource : validatedResources) { if (progress.isCanceled()) { return; } if (getLogger().isDebugEnabled()) { getLogger().debug(Messages.SarlBatchCompiler_23, resource.getURI().lastSegment()); } if (isWriteStorageFiles() && resource instanceof StorageAwareResource) { final StorageAwareResource storageAwareResource = (StorageAwareResource) resource; storageAwareResource.getResourceStorageFacade().saveResource(storageAwareResource, javaIoFileSystemAccess); } if (progress.isCanceled()) { return; } this.generator.generate(resource, javaIoFileSystemAccess, context); notifiesCompiledResourceReceiver(resource); } }
java
protected void generateJavaFiles(Iterable<Resource> validatedResources, IProgressMonitor progress) { assert progress != null; progress.subTask(Messages.SarlBatchCompiler_49); getLogger().info(Messages.SarlBatchCompiler_28, getOutputPath()); final JavaIoFileSystemAccess javaIoFileSystemAccess = this.javaIoFileSystemAccessProvider.get(); javaIoFileSystemAccess.setOutputConfigurations(this.outputConfigurations); // The function configureWorkspace should set the output paths with absolute paths. //javaIoFileSystemAccess.setOutputPath(getOutputPath().getAbsolutePath()); javaIoFileSystemAccess.setWriteTrace(isWriteTraceFiles()); if (progress.isCanceled()) { return; } final GeneratorContext context = new GeneratorContext(); context.setCancelIndicator(() -> progress.isCanceled()); for (final Resource resource : validatedResources) { if (progress.isCanceled()) { return; } if (getLogger().isDebugEnabled()) { getLogger().debug(Messages.SarlBatchCompiler_23, resource.getURI().lastSegment()); } if (isWriteStorageFiles() && resource instanceof StorageAwareResource) { final StorageAwareResource storageAwareResource = (StorageAwareResource) resource; storageAwareResource.getResourceStorageFacade().saveResource(storageAwareResource, javaIoFileSystemAccess); } if (progress.isCanceled()) { return; } this.generator.generate(resource, javaIoFileSystemAccess, context); notifiesCompiledResourceReceiver(resource); } }
[ "protected", "void", "generateJavaFiles", "(", "Iterable", "<", "Resource", ">", "validatedResources", ",", "IProgressMonitor", "progress", ")", "{", "assert", "progress", "!=", "null", ";", "progress", ".", "subTask", "(", "Messages", ".", "SarlBatchCompiler_49", ...
Generate the Java files from the SARL scripts. @param validatedResources the validatedResources for which the Java files could be generated. @param progress monitor of the progress of the compilation.
[ "Generate", "the", "Java", "files", "from", "the", "SARL", "scripts", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/compiler/batch/SarlBatchCompiler.java#L1531-L1563
train