org.eclipse.jst.jsf.context.symbol
Class InitializedSymbolFactory

java.lang.Object
  extended by org.eclipse.jst.jsf.context.symbol.InitializedSymbolFactory
Direct Known Subclasses:
JSFSymbolFactory

public class InitializedSymbolFactory
extends java.lang.Object

Creates purpose-built symbols and descriptors fully initialized (unlike the EMF factory that simply creates empty instances. This class is for convenience only and should not do anything that clients could not do by hand (though with more work). Clients may use or subclass.


Constructor Summary
InitializedSymbolFactory()
           
 
Method Summary
 ISymbol createBeanOrUnknownInstanceSymbol(IProject project, java.lang.String fullyQualifiedClass, java.lang.String symbolName, ERuntimeSource source)
          If fullyQualifiedClass can be resolved to an IType, then a bean instance symbol will be created.
 IComponentSymbol createJavaComponentSymbol(java.lang.String name, IJavaTypeDescriptor2 typeDesc, java.lang.String description)
           
 IComponentSymbol createJavaComponentSymbol(java.lang.String name, org.eclipse.jst.jsf.common.internal.types.ValueType valueType, java.lang.String description, IJavaProject javaProject)
           
 IJavaTypeDescriptor2 createTypeDescriptorFromSignature(java.lang.String signature, IJavaProject javaProject)
           
 IComponentSymbol createUnknownComponentSymbol(java.lang.String symbolName, ERuntimeSource source)
           
 IInstanceSymbol createUnknownInstanceSymbol(java.lang.String symbolName, ERuntimeSource source)
           
 java.lang.String getElementSignatureFromContainerType(org.eclipse.jst.jsf.common.internal.types.ValueType type)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InitializedSymbolFactory

public InitializedSymbolFactory()
Method Detail

createBeanOrUnknownInstanceSymbol

public final ISymbol createBeanOrUnknownInstanceSymbol(IProject project,
                                                       java.lang.String fullyQualifiedClass,
                                                       java.lang.String symbolName,
                                                       ERuntimeSource source)
If fullyQualifiedClass can be resolved to an IType, then a bean instance symbol will be created. If the type cannot be resolved, then createUnknownInstanceSymbol is called with the type descriptor on the returned symbol forced to fullyQualifiedClass.

Parameters:
project -
fullyQualifiedClass -
symbolName -
source -
Returns:
a symbol

createUnknownComponentSymbol

public final IComponentSymbol createUnknownComponentSymbol(java.lang.String symbolName,
                                                           ERuntimeSource source)
Parameters:
symbolName -
source -
Returns:
a symbol for a variable of unknown type

createUnknownInstanceSymbol

public final IInstanceSymbol createUnknownInstanceSymbol(java.lang.String symbolName,
                                                         ERuntimeSource source)
Parameters:
symbolName -
source -
Returns:
the unknown instance symbol as an IInstanceSymbol

createJavaComponentSymbol

public final IComponentSymbol createJavaComponentSymbol(java.lang.String name,
                                                        IJavaTypeDescriptor2 typeDesc,
                                                        java.lang.String description)
Parameters:
name - may NOT be null.
typeDesc - may NOT be null.
description - may be null
Returns:
a component symbol using the java type descriptor
Throws:
java.lang.IllegalArgumentException - if non-null argument is null

createJavaComponentSymbol

public final IComponentSymbol createJavaComponentSymbol(java.lang.String name,
                                                        org.eclipse.jst.jsf.common.internal.types.ValueType valueType,
                                                        java.lang.String description,
                                                        IJavaProject javaProject)
Parameters:
name -
valueType -
description -
javaProject -
Returns:
an IComponentSymbol that uses valueType to derive the type of its type descriptor

getElementSignatureFromContainerType

public final java.lang.String getElementSignatureFromContainerType(org.eclipse.jst.jsf.common.internal.types.ValueType type)
Parameters:
type -
Returns:
the signature of the element type of a collection/array, null, if untyped Collection or no container type at all.

createTypeDescriptorFromSignature

public final IJavaTypeDescriptor2 createTypeDescriptorFromSignature(java.lang.String signature,
                                                                    IJavaProject javaProject)
Parameters:
signature -
javaProject -
Returns:
a java type descriptor based on the fully qualified type specified by signature using javaProject as the lookup classpath. If the IType for signature cannot be found, the descriptor's typeSignatureDelegate will be used.