Java Code Examples for org.eclipse.core.runtime.IConfigurationElement

The following examples show how to use org.eclipse.core.runtime.IConfigurationElement. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: tmxeditor8   Source File: TbMatcher.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * 加载记忆库匹配实现 ;
 */
private void runExtension() {
	IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor(
			TERMMATCH_EXTENSION_ID);
	try {
		for (IConfigurationElement e : config) {
			final Object o = e.createExecutableExtension("class");
			if (o instanceof ITbMatch) {
				ISafeRunnable runnable = new ISafeRunnable() {

					public void handleException(Throwable exception) {
						logger.error(Messages.getString("match.TbMatcher.logger1"), exception);
					}

					public void run() throws Exception {
						termMatch = (ITbMatch) o;
					}
				};
				SafeRunner.run(runnable);
			}
		}
	} catch (CoreException ex) {
		logger.error(Messages.getString("match.TbMatcher.logger1"), ex);
	}
}
 
Example 2
/**
 * Reads property tab extensions. Returns all tab descriptors for the
 * current contributor id or an empty list if none is found.
 */
protected List readTabDescriptors() {
	List<TabDescriptor> result = new ArrayList<>();
	IConfigurationElement[] extensions = getConfigurationElements(EXTPT_TABS);
	for (IConfigurationElement extension : extensions) {
		IConfigurationElement[] tabs = extension.getChildren(ELEMENT_TAB);
		for (IConfigurationElement tab : tabs) {
			TabDescriptor descriptor = new TabDescriptor(tab);
			if (getIndex(propertyCategories.toArray(), descriptor
					.getCategory()) == -1) {
				/* tab descriptor has unknown category */
				handleTabError(tab, descriptor.getCategory() == null ? "" //$NON-NLS-1$
						: descriptor.getCategory());
			} else {
				result.add(descriptor);
			}
		}
	}
	return result;
}
 
Example 3
Source Project: elexis-3-core   Source File: TextContainer.java    License: Eclipse Public License 1.0 6 votes vote down vote up
private Optional<String> readUsingDataAccessExtension(Object object, String name){
	List<IConfigurationElement> placeholderExtensions =
		Extensions.getExtensions(ExtensionPointConstantsData.DATA_ACCESS, "TextPlaceHolder");
	for (IConfigurationElement iConfigurationElement : placeholderExtensions) {
		if (name.equals(iConfigurationElement.getAttribute("name"))
			&& object.getClass().getName().equals(iConfigurationElement.getAttribute("type"))) {
			try {
				ITextResolver resolver =
					(ITextResolver) iConfigurationElement.createExecutableExtension("resolver");
				return resolver.resolve(object);
			} catch (CoreException e) {
				log.warn(
					"Error getting resolver for name [" + name + "] object [" + object + "]");
			}
		}
	}
	return Optional.empty();
}
 
Example 4
Source Project: google-cloud-eclipse   Source File: LibraryFactory.java    License: Apache License 2.0 6 votes vote down vote up
private static List<Filter> getFilters(IConfigurationElement[] children) {
  List<Filter> filters = new ArrayList<>();
  for (IConfigurationElement childElement : children) {
    switch (childElement.getName()) {
      case ELEMENT_NAME_EXCLUSION_FILTER:
        filters.add(Filter.exclusionFilter(childElement.getAttribute(ATTRIBUTE_NAME_PATTERN)));
        break;
      case ELEMENT_NAME_INCLUSION_FILTER:
        filters.add(Filter.inclusionFilter(childElement.getAttribute(ATTRIBUTE_NAME_PATTERN)));
        break;
      default:
        // other child element of libraryFile, e.g.: mavenCoordinates
        break;
    }
  }
  return filters;
}
 
Example 5
Source Project: ice   Source File: AbstractModelBuilder.java    License: Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected void setServices(Item item) {
	// Give the Item the IMaterialsDatabase service.
	((Model) item).setMaterialsDatabase(materialsDatabase);

	// Let the base class set any other services.
	super.setServices(item);

	IConfigurationElement[] elements = Platform.getExtensionRegistry()
			.getConfigurationElementsFor(
					"org.eclipse.ice.item.IMaterialsDatabase");

	logger.info("Available configuration elements:");
	for (IConfigurationElement element : elements) {
		logger.info("Name" + element.getName());

	}

	return;
}
 
Example 6
protected void initProposalListeners(final EObject context) {
    proposalListeners.clear();
    final IConfigurationElement[] configurationElements = BonitaStudioExtensionRegistryManager.getInstance()
            .getConfigurationElements(PROPOSAL_LISTENER_EXTENSION_ID);
    // Filters duplicates
    for (final IConfigurationElement configElement : configurationElements) {
        final String type = configElement.getAttribute("type");
        if (type.equals(ExpressionConstants.VARIABLE_TYPE)) {
            IDataProposalListener extension;
            try {
                extension = (IDataProposalListener) configElement.createExecutableExtension("providerClass");
                if (extension.isRelevant(context, null) && !proposalListeners.contains(extension)) {
                    extension.setMultipleData(isMultipleData());
                    proposalListeners.add(extension);
                }
            } catch (final CoreException e) {
                BonitaStudioLog.error(e);
            }

        }
    }
}
 
Example 7
Source Project: tlaplus   Source File: TLCJob.java    License: MIT License 6 votes vote down vote up
/**
 * Retrieves all presenter of TLC job results
 * @return 
 */
protected static IResultPresenter[] getRegisteredResultPresenters()
{
    IConfigurationElement[] decls = Platform.getExtensionRegistry().getConfigurationElementsFor(
            IResultPresenter.EXTENSION_ID);

    Vector<IResultPresenter> validExtensions = new Vector<IResultPresenter>();
    for (int i = 0; i < decls.length; i++)
    {
        try
        {
            IResultPresenter extension = (IResultPresenter) decls[i].createExecutableExtension("class");
            validExtensions.add(extension);
        } catch (CoreException e)
        {
            TLCActivator.logError("Error instatiating the IResultPresenter extension", e);
        }
    }
    return validExtensions.toArray(new IResultPresenter[validExtensions.size()]);
}
 
Example 8
Source Project: dsl-devkit   Source File: CheckCfgUtil.java    License: Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Retrieves all property contributions from the checkcfg property extension point.
 *
 * @return the collection of all available property contributions, never {@code null}
 */
public static Collection<ICheckCfgPropertySpecification> getAllPropertyContributions() {
  Set<ICheckCfgPropertySpecification> contributions = Sets.newHashSet();
  IExtensionRegistry registry = Platform.getExtensionRegistry();
  if (registry != null) { // registry is null in the standalone builder...
    IConfigurationElement[] elements = registry.getConfigurationElementsFor(PROPERTY_EXTENSION_POINT);
    for (IConfigurationElement element : elements) {
      try {
        contributions.add((ICheckCfgPropertySpecification) element.createExecutableExtension(PROPERTY_EXECUTABLE_EXTENSION_ATTRIBUTE));
      } catch (CoreException e) {
        LOGGER.log(Level.WARN, "Failed to instantiate property from " + element.getContributor(), e);
      }
    }
  }
  return contributions;
}
 
Example 9
Source Project: neoscada   Source File: ConnectionCreatorHelper.java    License: Eclipse Public License 1.0 6 votes vote down vote up
public static ConnectionService createConnection ( final ConnectionInformation info, final Integer autoReconnectDelay, final boolean lazyActivation )
{
    if ( info == null )
    {
        return null;
    }

    for ( final IConfigurationElement ele : Platform.getExtensionRegistry ().getConfigurationElementsFor ( Activator.EXTP_CONNECTON_CREATOR ) )
    {
        final String interfaceName = ele.getAttribute ( "interface" );
        final String driverName = ele.getAttribute ( "driver" );
        if ( interfaceName == null || driverName == null )
        {
            continue;
        }
        if ( interfaceName.equals ( info.getInterface () ) && driverName.equals ( info.getDriver () ) )
        {
            final ConnectionService service = createConnection ( info, ele, autoReconnectDelay, lazyActivation );
            if ( service != null )
            {
                return service;
            }
        }
    }
    return null;
}
 
Example 10
Source Project: birt   Source File: DataSetProvider.java    License: Eclipse Public License 1.0 6 votes vote down vote up
/**
 * @param dataSetType
 * @param dataSourceType
 * @return
 */
public static IConfigurationElement findDataSetElement( String dataSetType,
		String dataSourceType )
{
	// NOTE: multiple data source types can support the same data set type
	IConfigurationElement dataSourceElem = findDataSourceElement( dataSourceType );
	if ( dataSourceElem != null )
	{
		// Find data set declared in the same extension
		IExtension ext = dataSourceElem.getDeclaringExtension( );
		IConfigurationElement[] elements = ext.getConfigurationElements( );
		for ( int n = 0; n < elements.length; n++ )
		{
			if ( elements[n].getAttribute( "id" ).equals( dataSetType ) ) //$NON-NLS-1$
			{
				return elements[n];
			}
		}
	}
	return null;
}
 
Example 11
Source Project: neoscada   Source File: ConfigurationHelper.java    License: Eclipse Public License 1.0 6 votes vote down vote up
private static EventHistoryViewConfiguration convertEventHistory ( final IConfigurationElement ele )
{
    try
    {
        final String id = ele.getAttribute ( "id" ); //$NON-NLS-1$
        final String connectionString = ele.getAttribute ( "connectionString" ); //$NON-NLS-1$
        final ConnectionType connectionType = ConnectionType.valueOf ( ele.getAttribute ( "connectionType" ) ); //$NON-NLS-1$
        final String label = ele.getAttribute ( "label" ); //$NON-NLS-1$

        final List<ColumnLabelProviderInformation> columnInformation = new LinkedList<ColumnLabelProviderInformation> ();
        fillColumnInformation ( columnInformation, ele );

        return new EventHistoryViewConfiguration ( id, connectionString, connectionType, label, columnInformation );
    }
    catch ( final Exception e )
    {
        logger.warn ( "Failed to convert event history configuration: {}", ele ); //$NON-NLS-1$
        return null;
    }
}
 
Example 12
/**
 * 加载记忆库匹配实现 ;
 */
private void runExtension() {
	IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor(EXTENSION_ID);
	try {
		for (IConfigurationElement e : config) {
			final Object o = e.createExecutableExtension("class");
			if (o instanceof ISimpleMatcher) {
				ISafeRunnable runnable = new ISafeRunnable() {

					public void handleException(Throwable exception) {
						logger.error(Messages.getString("simpleMatch.SimpleMatcherFactory.logger1"), exception);
					}

					public void run() throws Exception {
						ISimpleMatcher simpleMatcher = (ISimpleMatcher) o;							
						matchers.add(simpleMatcher);
					}
				};
				SafeRunner.run(runnable);
			}
		}
	} catch (CoreException ex) {
		logger.error(Messages.getString("simpleMatch.SimpleMatcherFactory.logger1"), ex);
	}
}
 
Example 13
/**
 * 加载记忆库匹配实现 ;
 */
private void runExtension() {
	IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor(EXTENSION_ID);
	try {
		for (IConfigurationElement e : config) {
			final Object o = e.createExecutableExtension("class");
			if (o instanceof ISimpleMatcher) {
				ISafeRunnable runnable = new ISafeRunnable() {

					public void handleException(Throwable exception) {
						logger.error(Messages.getString("simpleMatch.SimpleMatcherFactory.logger1"), exception);
					}

					public void run() throws Exception {
						ISimpleMatcher simpleMatcher = (ISimpleMatcher) o;							
						matchers.add(simpleMatcher);
					}
				};
				SafeRunner.run(runnable);
			}
		}
	} catch (CoreException ex) {
		logger.error(Messages.getString("simpleMatch.SimpleMatcherFactory.logger1"), ex);
	}
}
 
Example 14
public void configure(final IConfigurationElement desc) {
    name = desc.getAttribute("inputName");
    filterExtension = desc.getAttribute("filterExtensions");
    description = desc.getAttribute("description");
    priorityDisplay = Integer.valueOf(desc.getAttribute("priorityDisplay"));
    final String menuIcon = desc.getAttribute("menuIcon");
    try {
        if (menuIcon != null) {
            final Bundle b = Platform.getBundle(desc.getContributor().getName());
            final URL iconURL = b.getResource(menuIcon);
            final File imageFile = new File(FileLocator.toFileURL(iconURL).getFile());
            try (final FileInputStream inputStream = new FileInputStream(imageFile);) {
                descriptionImage = new Image(Display.getDefault(), inputStream);
            }
        }
    } catch (final Exception e) {
        BonitaStudioLog.error(e);
    }
}
 
Example 15
Source Project: tmxeditor8   Source File: SelfHelpDisplay.java    License: GNU General Public License v2.0 6 votes vote down vote up
private static void createHelpDisplay() {
	IExtensionPoint point = Platform.getExtensionRegistry()
			.getExtensionPoint(HELP_DISPLAY_EXTENSION_ID );
	if (point != null) {
		IExtension[] extensions = point.getExtensions();
		if (extensions.length != 0) {
			// We need to pick up the non-default configuration
			IConfigurationElement[] elements = extensions[0]
					.getConfigurationElements();
			if (elements.length == 0) 
				return;
			IConfigurationElement displayElement  = elements[0];
			// Instantiate the help display
			try {
				helpDisplay = (AbstractHelpDisplay) (displayElement
						.createExecutableExtension(HELP_DISPLAY_CLASS_ATTRIBUTE));
			} catch (CoreException e) {
				HelpBasePlugin.logStatus(e.getStatus());
			}
		}
	}
}
 
Example 16
Source Project: gwt-eclipse-plugin   Source File: ExtensionQuery.java    License: Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Return the data provided by all available plugins for the given extension
 * point and attribute name.
 */
@SuppressWarnings("unchecked")
public List<Data<T>> getData() {
  return getDataImpl(new DataRetriever<T>() {
    @Override
    public T getData(IConfigurationElement configurationElement,
        String attrName) {
      try {
        return (T) configurationElement.createExecutableExtension(attrName);
      } catch (CoreException ce) {
        CorePluginLog.logError(ce);
      }
      return null;
    }
  });
}
 
Example 17
Source Project: neoscada   Source File: Activator.java    License: Eclipse Public License 1.0 6 votes vote down vote up
public static List<ConfigurationFormInformation> findMatching ( final String factoryId )
{
    final List<ConfigurationFormInformation> result = new LinkedList<ConfigurationFormInformation> ();

    for ( final IConfigurationElement ele : Platform.getExtensionRegistry ().getConfigurationElementsFor ( EXTP_FORM ) )
    {
        if ( !"form".equals ( ele.getName () ) )
        {
            continue;
        }
        final ConfigurationFormInformation info = new ConfigurationFormInformation ( ele );
        if ( info.getFactoryIds () == null )
        {
            continue;
        }

        if ( info.getFactoryIds ().contains ( "*" ) || info.getFactoryIds ().contains ( factoryId ) )
        {
            result.add ( info );
        }
    }

    return result;
}
 
Example 18
Source Project: birt   Source File: BirtWizardUtil.java    License: Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Find Configuration Elements from Extension Registry by Extension ID
 * 
 * @param extensionId
 * @return
 */
public static IConfigurationElement[] findConfigurationElementsByExtension(
		String extensionId )
{
	if ( extensionId == null )
		return null;

	// find Extension Point entry
	IExtensionRegistry registry = Platform.getExtensionRegistry( );
	IExtensionPoint extensionPoint = registry.getExtensionPoint( extensionId );

	if ( extensionPoint == null )
	{
		return null;
	}

	return extensionPoint.getConfigurationElements( );
}
 
Example 19
/**
 * Return all child elements of this element that conform to the hierarchy of the
 * XML schema that goes with this extension point. The order the returned elements
 * is not specified here.
 * 
 * @return the child elements of this element
 */
public AbstractValidElementBase[] getChildElements() {
  AbstractValidElementBase[] childElements = null;
  if (childElements == null) {
    IConfigurationElement[] ce = getConfigurationElement().getChildren();
    ArrayList<AbstractValidElementBase> elements = new ArrayList<AbstractValidElementBase>();
    for (IConfigurationElement element : ce) {
      AbstractValidElementBase e = createChildElement(element);
      if (e != null) {
        elements.add(e);
      }
    }
    childElements = elements.toArray(new AbstractValidElementBase[elements.size()]);
  }
  return childElements;
}
 
Example 20
Source Project: neoscada   Source File: WorldRunner.java    License: Eclipse Public License 1.0 6 votes vote down vote up
private boolean isMatch ( final BundleContext ctx, final IConfigurationElement ele, final Object element )
{
    if ( isMatch ( Factories.loadClass ( ctx, ele, ATTR_FOR_CLASS ), element ) )
    {
        return true;
    }

    for ( final IConfigurationElement child : ele.getChildren ( ELE_FOR_CLASS ) )
    {
        if ( isMatch ( Factories.loadClass ( ctx, child, ATTR_CLASS ), element ) )
        {
            return true;
        }
    }
    return false;
}
 
Example 21
private IServer restoreServerConfiguration(IMemento memento, String id) throws CoreException
{
	IServer serverConfiguration = null;
	String typeId = memento.getString(ATTR_TYPE);
	if (typeId != null)
	{
		IConfigurationElement element = configurationElements.get(typeId);
		if (element != null)
		{
			Object object = element.createExecutableExtension(ATT_CLASS);
			if (object instanceof IServer)
			{
				serverConfiguration = (IServer) object;
				serverConfiguration.loadState(memento);
			}
		}
	}
	return serverConfiguration;
}
 
Example 22
public GeneratorDescriptor(IConfigurationElement configElement) {
	this.configElement = configElement;
	
	this.id = getAttribute(configElement, ATT_ID, null);
	if(this.id == null) {
		throw new IllegalArgumentException("Missing " + ATT_ID + " attribute");
	}
	
	this.name = getAttribute(configElement, ATT_NAME, null);
	if(this.id == null) {
		throw new IllegalArgumentException("Missing " + ATT_ID + " attribute");
	}

	this.clazz = getAttribute(configElement, ATT_CLASS, null);
	if(this.id == null) {
		throw new IllegalArgumentException("Missing " + ATT_ID + " attribute");
	}
	
	this.description = getAttribute(configElement, ATT_DESCRIPTION, null);
	this.icon = getAttribute(configElement, ATT_ICON, null);
}
 
Example 23
private IFileModificationValidator loadUIValidator() {
      IExtensionPoint extension = Platform.getExtensionRegistry().getExtensionPoint(ID, DEFAULT_FILE_MODIFICATION_VALIDATOR_EXTENSION);
if (extension != null) {
	IExtension[] extensions =  extension.getExtensions();
	if (extensions.length > 0) {
		IConfigurationElement[] configElements = extensions[0].getConfigurationElements();
		if (configElements.length > 0) {
			try {
                      Object o = configElements[0].createExecutableExtension("class"); //$NON-NLS-1$
                      if (o instanceof IFileModificationValidator) {
                          return (IFileModificationValidator)o;
                      }
                  } catch (CoreException e) {
                      SVNProviderPlugin.log(e.getStatus().getSeverity(), e.getMessage(), e);
                  }
		}
	}
}
return null;
  }
 
Example 24
private List<SimpleProxy<T>> createProxies(
    String extensionPointName,
    Class<T> klass,
    String elementName,
    String classNameAttr,
    String forcePluginActivationAttr) {
  List<SimpleProxy<T>> proxies = Lists.newArrayList();

  // Load the reference to the extension.
  IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(
      MechanicPlugin.PLUGIN_ID, extensionPointName);

  if (point == null) {
    LOG.log(Level.SEVERE,
        "Cannot load extension point " + MechanicPlugin.PLUGIN_ID + "/" + extensionPointName);
    return proxies;
  }
  // This loads all the registered extensions to this point.
  IExtension[] extensions = point.getExtensions();
  for (IExtension extension : extensions) {
    IConfigurationElement[] configurationElements = extension.getConfigurationElements();
    for (IConfigurationElement element : configurationElements) {
      if (element.getName().equals(elementName)) {
        SimpleProxy<T> proxy =
            SimpleProxy.create(klass, element, classNameAttr, forcePluginActivationAttr);
        // If parseType has an error, it returns null.
        if (proxy != null) {
          proxies.add(proxy);
        }
      }
    }
  }

  return proxies;
}
 
Example 25
Source Project: google-cloud-eclipse   Source File: LibraryFactoryTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testCreate_nonLibrary() {
  try {
    LibraryFactory.create(Mockito.mock(IConfigurationElement.class));
    Assert.fail();
  } catch (LibraryFactoryException ex) {
    Assert.assertNotNull(ex.getMessage());
  }
}
 
Example 26
public List<String> getXMLLSClassPathExtensions() {
	Map<IConfigurationElement, LemminxClasspathExtensionProvider> extensionProviders = getRegisteredClassPathProviders();

	List<String> classpathExtensions = new ArrayList<>();
	extensionProviders.entrySet().stream()
			.map(Entry<IConfigurationElement, LemminxClasspathExtensionProvider>::getValue)
			.map(LemminxClasspathExtensionProvider::get)
			.forEach(list -> list.forEach(jar -> classpathExtensions.add(jar.getAbsolutePath())));

	return classpathExtensions;
}
 
Example 27
Source Project: statecharts   Source File: FileExtensions.java    License: Eclipse Public License 1.0 5 votes vote down vote up
public static Iterable<FileExtensionDescriptor> getFileExtensions() {
	IConfigurationElement[] configurationElements = Platform.getExtensionRegistry().getConfigurationElementsFor(EXTENSION_POINT_ID);
	if (generatorDescriptors == null) {
		generatorDescriptors = transform(newArrayList(configurationElements), new CreateFileExtensions());
	}
	return generatorDescriptors;
}
 
Example 28
Source Project: birt   Source File: ExtensionPointManager.java    License: Eclipse Public License 1.0 5 votes vote down vote up
private ExtendedElementUIPoint createReportItemUIPoint( IExtension extension )
{
	IConfigurationElement[] elements = extension.getConfigurationElements( );
	if ( elements != null && elements.length > 0 )
	{
		return loadElements( elements );
	}
	return null;
}
 
Example 29
Source Project: bonita-studio   Source File: Repository.java    License: GNU General Public License v2.0 5 votes vote down vote up
@SuppressWarnings("unchecked")
protected IRepositoryStore<? extends IRepositoryFileStore> createRepositoryStore(
        final IConfigurationElement configuration, final IProgressMonitor monitor) throws CoreException {
    final IRepositoryStore<? extends IRepositoryFileStore> store;
    try {
        store = extensionContextInjectionFactory.make(configuration, CLASS, IRepositoryStore.class);
        monitor.subTask(Messages.bind(Messages.creatingStore, store.getDisplayName()));
        store.createRepositoryStore(this);
        monitor.worked(1);
        return store;
    } catch (final ClassNotFoundException e) {
        throw new CoreException(new Status(IStatus.ERROR, CommonRepositoryPlugin.PLUGIN_ID,
                "Failed to instantiate Repository store", e));
    }
}
 
Example 30
Source Project: n4js   Source File: EclipseRunnerDescriptor.java    License: Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Create a new runner descriptor from the given configuration element. Will perform extensive validity checks and
 * throw {@link IllegalArgumentException}s in case of errors.
 */
public EclipseRunnerDescriptor(IConfigurationElement configElem) {
	this.configElem = configElem;
	if (this.configElem == null) {
		throw new IllegalArgumentException("configElem may not be null");
	}

	this.id = configElem.getAttribute(ATTR_ID);
	if (this.id == null || this.id.trim().isEmpty()) {
		throw new IllegalArgumentException(
				"extension attribute '" + ATTR_ID + "' may not be null or empty");
	}

	this.name = configElem.getAttribute(ATTR_NAME);
	if (this.name == null || this.name.trim().isEmpty()) {
		throw new IllegalArgumentException(
				"extension attribute '" + ATTR_NAME + "' may not be null or empty");
	}

	final String environmentRaw = configElem.getAttribute(ATTR_ENVIRONMENT);
	if (environmentRaw == null || environmentRaw.trim().isEmpty()) {
		throw new IllegalArgumentException(
				"extension attribute '" + ATTR_ENVIRONMENT + "' may not be null or empty");
	}
	this.environment = RuntimeEnvironment.fromProjectName(new N4JSProjectName(environmentRaw));
	if (this.environment == null) {
		throw new IllegalArgumentException("unknown runtime environment: "
				+ environmentRaw
				+ " (valid values are: "
				+ Stream.of(RuntimeEnvironment.values()).map(re -> re.getProjectName().getRawName())
						.collect(Collectors.joining(", "))
				+ ")");
	}
}