Class AbstractDefinition
- java.lang.Object
-
- com._1c.g5.aef2.standard.definitions.AbstractDefinition
-
- All Implemented Interfaces:
IComponentFactory
,IDefinition
- Direct Known Subclasses:
ContainerDefinition
,LabeledDefinition
,SeparatorDefinition
public abstract class AbstractDefinition extends Object implements IDefinition
The basic class of the definition.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractDefinition(IDefinitionIdentifier id, Class<? extends IComponent<?>> componentClass)
Creates a new instance with void parameterization.protected
AbstractDefinition(IDefinitionIdentifier id, Class<? extends IComponent<?>> componentClass, IParameterization parameterization)
Creates a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IComponent<IModel>
createComponent(Object[] objects)
Creates a component with the specified EObjects as input.boolean
equals(Object obj)
Class<? extends IComponent<?>>
getComponentClass()
Returns the class of the component that was created using this definition last time.static Constructor<?>
getConstructor(Class<? extends IComponent<?>> classCandidate, IParameterization parameterizationCandidate, boolean logWarnings)
For aIComponent
class, returns a suitable constructor taking a given parameterization as the single argument.IDefinitionIdentifier
getId()
Returns the identifier of this definition.IAefLayoutData
getLayoutData()
Returns the layout data object that is expected to be applied to the component created by this definition.IParameterization
getParametrization()
Returns parameterization for component.IDefinition
getParent()
Returns the parent definition.int
hashCode()
void
setComponentClass(Class<? extends IComponent<?>> componentClass)
Sets the class of the component.void
setComponentFactory(IComponentFactory factory)
Sets the component factory which will be directly used in component creation.void
setLayoutData(IAefLayoutData layoutData)
Sets the layout data object.void
setModelFactory(IModelFactory modelFactory)
Sets the model factory.void
setParameterization(IParameterization parameterization)
Sets the parameterization of the component.void
setParent(IDefinition parent)
Sets the parent definition.
-
-
-
Constructor Detail
-
AbstractDefinition
protected AbstractDefinition(IDefinitionIdentifier id, Class<? extends IComponent<?>> componentClass, IParameterization parameterization)
Creates a new instance.- Parameters:
id
- the definition identifier, cannot benull
.componentClass
- the class of the component, can benull
.parameterization
- the parameterization, can benull
.
-
AbstractDefinition
protected AbstractDefinition(IDefinitionIdentifier id, Class<? extends IComponent<?>> componentClass)
Creates a new instance with void parameterization.- Parameters:
id
- the definition identifier, can benull
.componentClass
- the class of the component, can benull
.
-
-
Method Detail
-
getConstructor
public static Constructor<?> getConstructor(Class<? extends IComponent<?>> classCandidate, IParameterization parameterizationCandidate, boolean logWarnings)
For aIComponent
class, returns a suitable constructor taking a given parameterization as the single argument. If no such constructor exists,null
is returned.- Parameters:
classCandidate
- Class to look the constructor forparameterizationCandidate
- Parameterization for which the constructor will be searchedlogWarnings
- Iftrue
, a warning will be logged in case no constructor was found- Returns:
- Constructor or
null
-
getComponentClass
public Class<? extends IComponent<?>> getComponentClass()
Description copied from interface:IDefinition
Returns the class of the component that was created using this definition last time.- Specified by:
getComponentClass
in interfaceIDefinition
- Returns:
- the class of the AEF component created by this definition last time, may be
null
if the component was never created.
-
getLayoutData
public IAefLayoutData getLayoutData()
Description copied from interface:IDefinition
Returns the layout data object that is expected to be applied to the component created by this definition.- Specified by:
getLayoutData
in interfaceIDefinition
- Returns:
- the layout data, may be
null
.
-
getParent
public IDefinition getParent()
Description copied from interface:IDefinition
Returns the parent definition.- Specified by:
getParent
in interfaceIDefinition
- Returns:
- the parent definition, may be
null
if the definition has no parent.
-
getParametrization
public IParameterization getParametrization()
Description copied from interface:IDefinition
Returns parameterization for component.- Specified by:
getParametrization
in interfaceIDefinition
- Returns:
- the parameterization, may be
null
.
-
getId
public final IDefinitionIdentifier getId()
Description copied from interface:IDefinition
Returns the identifier of this definition.- Specified by:
getId
in interfaceIDefinition
- Returns:
- the identifier of the definition, may be
null
.
-
setParent
public void setParent(IDefinition parent)
Sets the parent definition.- Parameters:
parent
- the parent definition to set
-
setLayoutData
public void setLayoutData(IAefLayoutData layoutData)
Sets the layout data object.- Parameters:
layoutData
- the layout data.
-
setModelFactory
public void setModelFactory(IModelFactory modelFactory)
Sets the model factory.- Parameters:
modelFactory
- the model factory instance. Cannot benull
.
-
setComponentClass
public void setComponentClass(Class<? extends IComponent<?>> componentClass)
Sets the class of the component.Note that if a direct component factory is
set
, the class set by this method will be ignored during component creation.- Parameters:
componentClass
- the class of the component.
-
setParameterization
public void setParameterization(IParameterization parameterization)
Sets the parameterization of the component.Note that if a direct component factory is
set
, the parameterization set by this method will be ignored during component creation.- Parameters:
parameterization
- the parameterization to set.
-
setComponentFactory
public void setComponentFactory(IComponentFactory factory)
Sets the component factory which will be directly used in component creation.Note that if this method was called, the component class and parameterization info will not be used.
- Parameters:
factory
- the component factory to set
-
createComponent
public IComponent<IModel> createComponent(Object[] objects)
Description copied from interface:IComponentFactory
Creates a component with the specified EObjects as input.- Specified by:
createComponent
in interfaceIComponentFactory
- Parameters:
objects
- the EObjects comprising the input of the definition, may benull
- Returns:
- a component, never
null
-
-