|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.emf.emfstore.common.extensionpoint.ESExtensionElement
public final class ESExtensionElement
This is the companion class to ESExtensionPoint
.
It wraps a IConfigurationElement
for convenience purposes.
As ESExtensionPoint
it can be configured to return null or throw an runtime exception
ESExtensionPointException
Constructor Summary | |
---|---|
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. |
Method Summary | ||
---|---|---|
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. |
|
|
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. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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 nullMethod Detail |
---|
public Boolean getBoolean(String name)
name
- attribute id
ESExtensionPointException
is thrownpublic Boolean getBoolean(String name, boolean defaultValue)
name
- attribute iddefaultValue
- the default value
ESExtensionPointException
is thrownpublic Integer getInteger(String name)
name
- attribute id
ESExtensionPointException
is thrownpublic String getAttribute(String name)
name
- attribute id
ESExtensionPointException
is thrownpublic <T> T getClass(String classAttributeName, Class<T> returnType)
T
- type of classclassAttributeName
- attribute name of the class attributereturnType
- expected class type
ESExtensionPointException
is thrownpublic org.eclipse.core.runtime.IConfigurationElement getIConfigurationElement()
IConfigurationElement
public void setThrowException(boolean throwException)
throwException
- if true, exceptions are thrownpublic boolean getThrowException()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |