EGF Engine
Release 0.1.0

org.eclipse.egf.model.contract.type
Class ClassTypeHolder

java.lang.Object
  extended by org.eclipse.egf.model.contract.type.AbstractTypeHolder
      extended by org.eclipse.egf.model.contract.type.ClassTypeHolder
All Implemented Interfaces:
ITypeHolder

public abstract class ClassTypeHolder
extends AbstractTypeHolder

Default class type holder.
Must be subclassed so as to provide the expected type.
The expected type is the one used to check class name value (as string representation) in the method#isValidType(String)


Constructor Summary
ClassTypeHolder()
           
 
Method Summary
abstract  Class<?> getExpectedType()
          Get the expected java type.
 Object getValue(String value_p)
          Convert value from string to object.
 boolean isJava()
          Is it standing for a java type (ie a class) ?
 boolean isValid(String value_p)
          Is value string representation valid ?
protected  boolean isValidType(Object classInstance_p)
          Is given class instance valid ?
 void setClassLoader(ClassLoader classLoader_p)
          Set the class loader.
 void setPluginId(String pluginId_p)
          Set the id of the plug-in responsible to deal with the given value in ITypeHolder.getValue(String) and ITypeHolder.isValid(String).
 
Methods inherited from class org.eclipse.egf.model.contract.type.AbstractTypeHolder
getSelectionDialog, getSelectionHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassTypeHolder

public ClassTypeHolder()
Method Detail

setPluginId

public void setPluginId(String pluginId_p)
Description copied from interface: ITypeHolder
Set the id of the plug-in responsible to deal with the given value in ITypeHolder.getValue(String) and ITypeHolder.isValid(String).
The plug-in id is provided to get the related bundle to figure out class loader issues for instance.

Parameters:
pluginId_p - must be the id of the plug-in not its name (e.g "org.eclipse.core.runtime").
See Also:
ITypeHolder.setPluginId(java.lang.String)

setClassLoader

public void setClassLoader(ClassLoader classLoader_p)
Set the class loader.

Parameters:
classLoader_p - the classLoader to set

getValue

public Object getValue(String value_p)
Description copied from interface: ITypeHolder
Convert value from string to object.

Returns:
See Also:
ITypeHolder.getValue(java.lang.String)

isJava

public boolean isJava()
Description copied from interface: ITypeHolder
Is it standing for a java type (ie a class) ?

Returns:
See Also:
ITypeHolder.isJava()

isValid

public boolean isValid(String value_p)
Description copied from interface: ITypeHolder
Is value string representation valid ?

Returns:
See Also:
ITypeHolder.isValid(java.lang.String)

isValidType

protected boolean isValidType(Object classInstance_p)
Is given class instance valid ?

Parameters:
classInstance_p -
Returns:
true means valid; false otherwise.
See Also:
getExpectedType()

getExpectedType

public abstract Class<?> getExpectedType()
Get the expected java type.
The returned type must have a default constructor.

Returns:
The expected Java class tested in isValidType(Object).

EGF Engine
Release 0.1.0

Copyright (c) Thales Corporate Services S.A.S, 2009.

This page is made available under license. For full details see the LEGAL in the documentation book that contains this page.