Class SourceFactory
java.lang.Object
is.galia.source.SourceFactory
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumHow sources are chosen bynewSource(java.lang.String). -
Method Summary
Modifier and TypeMethodDescriptionstatic SourcenewSource(Identifier identifier, Delegate delegate) IfKey.SOURCE_STATICis not set, uses a delegate method to return an instance of a source for the given identifier.static SourceRetrieves an instance by name.
-
Method Details
-
getAllSources
-
getSelectionStrategy
- Returns:
- How sources are chosen by
newSource(java.lang.String).
-
newSource
public static Source newSource(String name) throws ClassNotFoundException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException Retrieves an instance by name.- Parameters:
name- Class name of the built-in source, or plugin name of the plugin source.- Returns:
- Instance with the given name.
- Throws:
ClassNotFoundExceptionNoSuchMethodExceptionInstantiationExceptionIllegalAccessExceptionInvocationTargetException
-
newSource
If
Key.SOURCE_STATICis not set, uses a delegate method to return an instance of a source for the given identifier. Otherwise, returns an instance of the source specified inKey.SOURCE_STATIC.Sources are matched in the following order:
- Plugin sources with matching
names - Built-in sources with matching simple names
- Built-in sources with matching fully qualified names
- Parameters:
identifier- Identifier of the source image.delegate- Delegate. May benullifgetSelectionStrategy()returnsSourceFactory.SelectionStrategy.STATIC.- Returns:
- Instance of the appropriate source for the given identifier, with identifier already set.
- Throws:
IllegalArgumentException- if the proxy argument isnullwhile usingSourceFactory.SelectionStrategy.DELEGATE_SCRIPT.Exception
- Plugin sources with matching
-