- java.lang.Object
-
- org.praxislive.base.AbstractComponentFactory
-
- All Implemented Interfaces:
ComponentFactory
public class AbstractComponentFactory extends Object implements ComponentFactory
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractComponentFactory.Data<T>-
Nested classes/interfaces inherited from interface org.praxislive.core.services.ComponentFactory
ComponentFactory.MetaData<T>, ComponentFactory.Redirect
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractComponentFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidadd(String type, Class<? extends Component> cls)protected voidadd(String type, AbstractComponentFactory.Data<? extends Component> info)protected voidaddRoot(String type, Class<? extends Root> cls)protected voidaddRoot(String type, AbstractComponentFactory.Data<? extends Root> info)Stream<ComponentType>componentTypes()Component types provided by this factory.ComponentcreateComponent(ComponentType type)Create an instance of the component associated with this type.RootcreateRootComponent(ComponentType type)static <T> AbstractComponentFactory.Data<T>data(Class<T> cls)ComponentFactory.MetaData<? extends Component>getMetaData(ComponentType type)ComponentFactory.MetaData<? extends Root>getRootMetaData(ComponentType type)Stream<ComponentType>rootTypes()Root types provided by this factory.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.praxislive.core.services.ComponentFactory
componentData, componentRedirect, createRoot, getFactoryService, getRootFactoryService, rootData, rootRedirect
-
-
-
-
Method Detail
-
componentTypes
public Stream<ComponentType> componentTypes()
Description copied from interface:ComponentFactoryComponent types provided by this factory.- Specified by:
componentTypesin interfaceComponentFactory- Returns:
- stream of component types
-
rootTypes
public Stream<ComponentType> rootTypes()
Description copied from interface:ComponentFactoryRoot types provided by this factory.- Specified by:
rootTypesin interfaceComponentFactory- Returns:
- stream of root types
-
createComponent
public Component createComponent(ComponentType type) throws ComponentInstantiationException
Description copied from interface:ComponentFactoryCreate an instance of the component associated with this type. Component factories with a redirect may not support this method, and always throw an exception. The default implementation always throws an exception.- Specified by:
createComponentin interfaceComponentFactory- Parameters:
type- component type to create- Returns:
- created component instance
- Throws:
ComponentInstantiationException
-
createRootComponent
public Root createRootComponent(ComponentType type) throws ComponentInstantiationException
- Specified by:
createRootComponentin interfaceComponentFactory- Throws:
ComponentInstantiationException
-
getMetaData
public ComponentFactory.MetaData<? extends Component> getMetaData(ComponentType type)
- Specified by:
getMetaDatain interfaceComponentFactory
-
getRootMetaData
public ComponentFactory.MetaData<? extends Root> getRootMetaData(ComponentType type)
- Specified by:
getRootMetaDatain interfaceComponentFactory
-
add
protected void add(String type, AbstractComponentFactory.Data<? extends Component> info)
-
addRoot
protected void addRoot(String type, AbstractComponentFactory.Data<? extends Root> info)
-
data
public static <T> AbstractComponentFactory.Data<T> data(Class<T> cls)
-
-