Package net.officefloor.plugin.variable
Class VariableManagedObjectSource<T>
- java.lang.Object
-
- net.officefloor.frame.api.managedobject.source.impl.AbstractAsyncManagedObjectSource<O,F>
-
- net.officefloor.frame.api.managedobject.source.impl.AbstractManagedObjectSource<None,None>
-
- net.officefloor.plugin.variable.VariableManagedObjectSource<T>
-
- All Implemented Interfaces:
ManagedObjectSource<None,None>
public class VariableManagedObjectSource<T> extends AbstractManagedObjectSource<None,None>
VariableManagedObjectSource
.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.officefloor.frame.api.managedobject.source.impl.AbstractAsyncManagedObjectSource
AbstractAsyncManagedObjectSource.DependencyLabeller<K extends java.lang.Enum<K>>, AbstractAsyncManagedObjectSource.ExecutionLabeller, AbstractAsyncManagedObjectSource.Labeller<K extends java.lang.Enum<K>>, AbstractAsyncManagedObjectSource.MetaDataContext<O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>, AbstractAsyncManagedObjectSource.SpecificationContext
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
VARIABLE_NAME_PREFIX
Prefix for variable name.
-
Constructor Summary
Constructors Constructor Description VariableManagedObjectSource()
Default constructor.VariableManagedObjectSource(java.util.function.Consumer<Var<T>> decorator)
Instantiate.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.String
extractVariableType(java.lang.reflect.Type variableGenericType)
Extracts the type from the variable.protected ManagedObject
getManagedObject()
Synchronously obtains theManagedObject
.static <T> In<T>
in(java.lang.Object object)
ObtainsIn
from dependency object.protected void
loadMetaData(AbstractAsyncManagedObjectSource.MetaDataContext<None,None> context)
Overridden to load meta-data.protected void
loadSpecification(AbstractAsyncManagedObjectSource.SpecificationContext context)
Overridden to load specifications.static java.lang.String
name(java.lang.String qualifier, java.lang.String type)
Obtains the variable name.static <T> Out<T>
out(java.lang.Object object)
ObtainsOut
from dependency object.static java.lang.String
type(java.lang.String type)
Obtains the variable type.static <T> T
val(java.lang.Object object)
Obtains the value from dependency object.static <T> Var<T>
var(java.lang.Object object)
ObtainsVar
from dependency object.-
Methods inherited from class net.officefloor.frame.api.managedobject.source.impl.AbstractManagedObjectSource
sourceManagedObject
-
Methods inherited from class net.officefloor.frame.api.managedobject.source.impl.AbstractAsyncManagedObjectSource
getSpecification, init, start, stop
-
-
-
-
Field Detail
-
VARIABLE_NAME_PREFIX
public static final java.lang.String VARIABLE_NAME_PREFIX
Prefix for variable name.- See Also:
- Constant Field Values
-
-
Method Detail
-
extractVariableType
public static java.lang.String extractVariableType(java.lang.reflect.Type variableGenericType)
Extracts the type from the variable.- Parameters:
variableGenericType
- VariableType
.- Returns:
- Variable type.
-
var
public static <T> Var<T> var(java.lang.Object object) throws java.lang.IllegalStateException
ObtainsVar
from dependency object.- Parameters:
object
- Dependency object.- Returns:
Var
wrapper on dependency object.- Throws:
java.lang.IllegalStateException
- If fails to convert.
-
out
public static <T> Out<T> out(java.lang.Object object)
ObtainsOut
from dependency object.- Parameters:
object
- Dependency object.- Returns:
Out
wrapper on dependency object.
-
in
public static <T> In<T> in(java.lang.Object object)
ObtainsIn
from dependency object.- Parameters:
object
- Dependency object.- Returns:
In
wrapper on dependency object.
-
val
public static <T> T val(java.lang.Object object)
Obtains the value from dependency object.- Parameters:
object
- Dependency object.- Returns:
- Value extracted from dependency object.
-
type
public static java.lang.String type(java.lang.String type)
Obtains the variable type.- Parameters:
type
- Raw type name.- Returns:
- Variable type.
-
name
public static java.lang.String name(java.lang.String qualifier, java.lang.String type)
Obtains the variable name.- Parameters:
qualifier
- Qualifier for variable.type
- Variable type.- Returns:
- Name for the variable.
-
loadSpecification
protected void loadSpecification(AbstractAsyncManagedObjectSource.SpecificationContext context)
Description copied from class:AbstractAsyncManagedObjectSource
Overridden to load specifications.- Specified by:
loadSpecification
in classAbstractAsyncManagedObjectSource<None,None>
- Parameters:
context
- Specifications.
-
loadMetaData
protected void loadMetaData(AbstractAsyncManagedObjectSource.MetaDataContext<None,None> context) throws java.lang.Exception
Description copied from class:AbstractAsyncManagedObjectSource
Overridden to load meta-data.- Specified by:
loadMetaData
in classAbstractAsyncManagedObjectSource<None,None>
- Parameters:
context
- Meta-data.- Throws:
java.lang.Exception
- If fails to load the meta-data.
-
getManagedObject
protected ManagedObject getManagedObject() throws java.lang.Throwable
Description copied from class:AbstractManagedObjectSource
Synchronously obtains theManagedObject
.- Specified by:
getManagedObject
in classAbstractManagedObjectSource<None,None>
- Returns:
ManagedObject
.- Throws:
java.lang.Throwable
- If fails to obtain theManagedObject
.
-
-