code stringlengths 73 34.1k | label stringclasses 1
value |
|---|---|
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 generateLicenseFile() {
final CharSequence licenseText = getLicenseText();
if (licenseText != null) {
final String text = licenseText.toString();
if (!Strings.isEmpty(text)) {
writeFile(LICENSE_FILE, text.getBytes());
}
}
} | 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);... | 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<>();
... | 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;
} | 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(BL... | 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);... | 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$
... | 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)... | 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$
}))... | 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... | 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$
}));
}
retur... | 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$
... | 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$
}));
... | 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"); //$N... | java |
protected Map<String, ?> pattern(Procedure1<? super Pattern> proc) {
final Pattern patternDefinition = new Pattern();
proc.apply(patternDefinition);
return patternDefinition.getDefinition();
} | java |
@SuppressWarnings("static-method")
@Provides
@Singleton
public ExtraLanguageListCommand provideExtraLanguageListCommand(BootLogger bootLogger,
Provider<IExtraLanguageContributions> contributions) {
return new ExtraLanguageListCommand(bootLogger, contributions);
} | 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(regionFo... | java |
protected void _format(SarlCapacity capacity, IFormattableDocument document) {
formatAnnotations(capacity, document, XbaseFormatterPreferenceKeys.newLineAfterClassAnnotations);
formatModifiers(capacity, document);
final ISemanticRegionsFinder regionFor = this.textRegionExtensions.regionFor(capacity);
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(regionFo... | java |
protected void _format(SarlBehavior behavior, IFormattableDocument document) {
formatAnnotations(behavior, document, XbaseFormatterPreferenceKeys.newLineAfterClassAnnotations);
formatModifiers(behavior, document);
final ISemanticRegionsFinder regionFor = this.textRegionExtensions.regionFor(behavior);
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(regionFo... | java |
protected void _format(SarlBehaviorUnit behaviorUnit, IFormattableDocument document) {
formatAnnotations(behaviorUnit, document, XbaseFormatterPreferenceKeys.newLineAfterMethodAnnotations);
final ISemanticRegionsFinder regionFor = this.textRegionExtensions.regionFor(behaviorUnit);
document.append(regionFor.keyw... | 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(), d... | 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(requiredCapacit... | 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... | 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(
... | java |
protected StyledString parametersToStyledString(Iterable<? extends JvmFormalParameter> elements, boolean isVarArgs, boolean includeName) {
return getParameterStyledString(elements, isVarArgs, includeName, this.keywords, this.annotationFinder, this);
} | 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 Itera... | java |
@Inject
public void setFileExtensions(@Named(Constants.FILE_EXTENSIONS) String fileExtensions) {
this.fileExtensions.clear();
this.fileExtensions.addAll(Arrays.asList(fileExtensions.split("[,;: ]+"))); //$NON-NLS-1$
} | 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) {
... | java |
protected boolean isSarlResource(Object resource) {
if (resource instanceof IFile) {
final IFile file = (IFile) resource;
return getFileExtensions().contains(file.getFileExtension());
}
return false;
} | 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.fireSRE... | 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);
... | 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),... | 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 = getTypeExtension... | 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());
... | java |
protected boolean writeFile(QualifiedName name, ExtraLanguageAppendable appendable, IExtraLanguageGeneratorContext context) {
final ExtraLanguageAppendable fileAppendable = createAppendable(null, context);
generateFileHeader(name, fileAppendable, context);
final ImportManager importManager = appendable.getImport... | java |
protected IExtraLanguageGeneratorContext createGeneratorContext(IFileSystemAccess2 fsa, IGeneratorContext context,
Resource resource) {
if (context instanceof IExtraLanguageGeneratorContext) {
return (IExtraLanguageGeneratorContext) context;
}
return new ExtraLanguageGeneratorContext(context, fsa, this, res... | 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 {
con... | 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;
... | java |
protected LightweightTypeReference getExpectedType(XExpression expr) {
final IResolvedTypes resolvedTypes = getTypeResolver().resolveTypes(expr);
final LightweightTypeReference actualType = resolvedTypes.getActualType(expr);
return actualType;
} | 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 JvmO... | 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();
}
compa... | 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.setSpecificSARLC... | java |
@SuppressWarnings({"checkstyle:magicnumber", "checkstyle:npathcomplexity"})
protected void addSourceFolders(
IMavenProjectFacade facade, SARLConfiguration config,
IClasspathDescriptor classpath, IProgressMonitor monitor)
throws CoreException {
assertHasNature(facade.getProject(), SARLEclipseConfig.NATURE... | 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;
... | 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 mo... | 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 = getParamet... | 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 = getParameterV... | java |
@SuppressWarnings("static-method")
protected void addSarlLibraries(IClasspathDescriptor classpath) {
final IClasspathEntry entry = JavaCore.newContainerEntry(SARLClasspathContainerInitializer.CONTAINER_ID);
classpath.addEntry(entry);
} | 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);
} | 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 nu... | java |
public boolean isSarlAgent(LightweightTypeReference type) {
return !type.isInterfaceType() && (getSarlElementEcoreType(type) == SarlPackage.SARL_AGENT
|| type.isSubtypeOf(Agent.class));
} | java |
public boolean isSarlBehavior(LightweightTypeReference type) {
return !type.isInterfaceType() && (getSarlElementEcoreType(type) == SarlPackage.SARL_BEHAVIOR
|| type.isSubtypeOf(Behavior.class));
} | java |
public boolean isSarlCapacity(LightweightTypeReference type) {
return type.isInterfaceType() && (getSarlElementEcoreType(type) == SarlPackage.SARL_CAPACITY
|| type.isSubtypeOf(Capacity.class));
} | java |
public boolean isSarlEvent(LightweightTypeReference type) {
return !type.isInterfaceType() && (getSarlElementEcoreType(type) == SarlPackage.SARL_EVENT
|| type.isSubtypeOf(Event.class));
} | java |
public boolean isSarlSkill(LightweightTypeReference type) {
return !type.isInterfaceType() && (getSarlElementEcoreType(type) == SarlPackage.SARL_SKILL
|| type.isSubtypeOf(Skill.class));
} | java |
public ADDRESST unregisterParticipant(ADDRESST address, EventListener entity) {
synchronized (mutex()) {
removeListener(address);
this.participants.remove(entity.getID(), address);
}
return address;
} | java |
public SynchronizedCollection<ADDRESST> getAddresses(UUID participant) {
final Object mutex = mutex();
synchronized (mutex) {
return Collections3.synchronizedCollection(this.participants.get(participant), mutex);
}
} | java |
public boolean markAssignmentAccess(EObject object) {
assert object != null;
if (!isAssigned(object)) {
return object.eAdapters().add(ASSIGNMENT_MARKER);
}
return false;
} | java |
@SuppressWarnings("static-method")
public boolean isAssigned(final EObject object) {
assert object != null;
return object.eAdapters().contains(ASSIGNMENT_MARKER);
} | 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-N... | 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 p... | 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)... | java |
public static void setSystemSARLConfigurationFor(IProject project) {
final IPreferenceStore preferenceStore = getSARLPreferencesFor(project);
preferenceStore.setValue(IS_PROJECT_SPECIFIC, false);
} | 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... | 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.... | 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;
} | java |
protected BlockExpressionContextDescription getBlockExpressionContextDescription() {
for (final CodeElementExtractor.ElementDescription containerDescription : getCodeElementExtractor().getTopElements(
getGrammar(), getCodeBuilderConfig())) {
if (!getCodeBuilderConfig().getNoActionBodyTypes().contains(container... | java |
public <T> int getRegisteredEventListeners(Class<T> type, Collection<? super T> collection) {
synchronized (this.behaviorGuardEvaluatorRegistry) {
return this.behaviorGuardEvaluatorRegistry.getRegisteredEventListeners(type, collection);
}
} | java |
private void executeBehaviorMethodsInParalellWithSynchroAtTheEnd(Collection<Runnable> behaviorsMethodsToExecute)
throws InterruptedException, ExecutionException {
final CountDownLatch doneSignal = new CountDownLatch(behaviorsMethodsToExecute.size());
final OutputParameter<Throwable> runException = new OutputPa... | java |
private void executeAsynchronouslyBehaviorMethods(Collection<Runnable> behaviorsMethodsToExecute) {
for (final Runnable runnable : behaviorsMethodsToExecute) {
this.executor.execute(runnable);
}
} | 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.get... | 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.RuntimeE... | java |
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(SarlBehavior behavior) {
final JvmDeclaredType jvmElement = this.jvmModelAssociations.getInferredType(behavior);
return this.images.forBehavior(
behavior.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));
} | java |
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(SarlEvent event) {
final JvmDeclaredType jvmElement = this.jvmModelAssociations.getInferredType(event);
return this.images.forEvent(
event.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));
} | java |
public ImageDescriptor image(SarlField attribute) {
return this.images.forField(
attribute.getVisibility(),
this.adornments.get(this.jvmModelAssociations.getJvmField(attribute)));
} | 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)));
} | 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 = a... | 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);
}
} | java |
public void setLogger(Logger logger) {
this.logger = logger == null ? LoggerFactory.getLogger(getClass()) : logger;
} | java |
public void setBaseURI(org.eclipse.emf.common.util.URI basePath) {
this.baseUri = basePath;
} | java |
@Pure
public List<File> getBootClassPath() {
if (this.bootClasspath == null) {
return Collections.emptyList();
}
return Collections.unmodifiableList(this.bootClasspath);
} | 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));
}
} | java |
@Pure
public List<File> getClassPath() {
if (this.classpath == null) {
return Collections.emptyList();
}
return Collections.unmodifiableList(this.classpath);
} | 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$
... | 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());
}
th... | 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));
}
} | java |
public void addSourcePath(File sourcePath) {
if (this.sourcePath == null) {
this.sourcePath = new ArrayList<>();
}
this.sourcePath.add(sourcePath);
} | java |
@Pure
public List<File> getSourcePaths() {
if (this.sourcePath == null) {
return Collections.emptyList();
}
return Collections.unmodifiableList(this.sourcePath);
} | 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, lo... | 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) {
... | 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 WAR... | 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.... | 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.javaIoFileSy... | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.