public final class ESExtensionElement extends Object
ESExtensionPoint.
It wraps a IConfigurationElement for convenience purposes.
As ESExtensionPoint it can be configured to return null or throw an runtime exception
ESExtensionPointException| Constructor and Description |
|---|
ESExtensionElement(org.eclipse.core.runtime.IConfigurationElement element)
Default constructor.
|
ESExtensionElement(org.eclipse.core.runtime.IConfigurationElement element,
boolean throwExceptions)
Constructor, allowing to set whether exceptions should be thrown instead of returning null.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getAttribute(String name)
Returns an attribute as string.
|
Boolean |
getBoolean(String name)
Returns the value of the boolean attribute, if existing, or false otherwise.
|
Boolean |
getBoolean(String name,
boolean defaultValue)
Returns the value of the boolean attribute, if existing, or given defaultValue otherwise.
|
<T> T |
getClass(String classAttributeName,
Class<T> returnType)
Returns a class, or rather the registered instance of this class.
|
org.eclipse.core.runtime.IConfigurationElement |
getIConfigurationElement()
Returns the wrapped element.
|
Integer |
getInteger(String name)
Returns an Integer attribute.
|
boolean |
getThrowException()
Returns whether exceptions are thrown or null is returned.
|
void |
setThrowException(boolean throwException)
Set wrapper to throw exceptions or otherwise return null.
|
public ESExtensionElement(org.eclipse.core.runtime.IConfigurationElement element)
element - element to be wrappedpublic ESExtensionElement(org.eclipse.core.runtime.IConfigurationElement element,
boolean throwExceptions)
element - element to be wrappedthrowExceptions - if true exceptions are thrown instead of returning nullpublic Boolean getBoolean(String name)
name - attribute idESExtensionPointException is thrownpublic Boolean getBoolean(String name, boolean defaultValue)
name - attribute iddefaultValue - the default valueESExtensionPointException is thrownpublic Integer getInteger(String name)
name - attribute idESExtensionPointException is thrownpublic String getAttribute(String name)
name - attribute idESExtensionPointException is thrownpublic <T> T getClass(String classAttributeName, Class<T> returnType)
T - type of classclassAttributeName - attribute name of the class attributereturnType - expected class typeESExtensionPointException is thrownpublic org.eclipse.core.runtime.IConfigurationElement getIConfigurationElement()
IConfigurationElementpublic void setThrowException(boolean throwException)
throwException - if true, exceptions are thrownpublic boolean getThrowException()
Copyright © 2017. All rights reserved.