![]() |
lingua-franca 0.10.1
Lingua Franca code generator
|
Subclass of TargetConfig with a specialized constructor for creating configurations for federates. More...
Inherits org.lflang.target.TargetConfig.
Public Member Functions | |
| TargetDecl | extractTargetDecl () |
| Construct a TargetDecl by extracting the fields of the given TargetConfig. | |
| FederateTargetConfig (LFGeneratorContext context, Resource federateResource) | |
| Create a configuration for a federate given a main context and the resource in which the class of the federate is specified. | |
| Optional< TargetProperty<?, ?> > | forName (String name) |
| Return the target property in this target config that matches the given string. | |
| List< TargetProperty<?, ?> > | getAssignedProperties () |
| Return the target properties that have been assigned a value. | |
| Resource | getMainResource () |
| Get the main resource that is under compilation. | |
| List< TargetProperty<?, ?> > | getRegisteredProperties () |
| Return the target properties that are currently registered. | |
| boolean | isFederated () |
| Return whether this configuration is used in the context of a federated program. | |
| boolean | isSet (TargetProperty<?, ?> property) |
| Return true if this target property has been set (past initialization), false otherwise. | |
| boolean | isSupported (TargetProperty p) |
| Return true if the given target property is supported, false otherwise. | |
| String | listOfRegisteredProperties () |
| Return the target properties that are currently registered. | |
| void | load (GeneratorArguments args, MessageReporter err) |
| Load overrides passed in as CLI arguments. | |
| List< TargetProperty<?, ?> > | loaded () |
| Return all the target properties that have been set. | |
| void | mergeImportedConfig (Resource importedResource, Resource mainResource, Predicate< TargetProperty > loadOrNot, MessageReporter messageReporter) |
| If the federate that the target configuration applies to is imported, merge target properties declared in the file that it was imported from. | |
| void | register (TargetProperty<?, ?>... properties) |
| Register target properties and assign them their initial value. | |
| void | reportUnsupportedTargetProperty (String name, MessageReporter.Stage2 stage2) |
| Report that a target property is not supported by the current target. | |
| void | reset (TargetProperty<?, ?> property) |
| Reset this target property to its initial value (and mark it as unset). | |
| String | settings () |
| Return a description of the current settings. | |
| void | update (TargetConfig config, List< KeyValuePair > pairs, Path relativePath, Predicate< TargetProperty > loadOrNot, MessageReporter err) |
| Update the given configuration using the given target properties. | |
| void | validate (MessageReporter reporter) |
| Validate all set properties and report issues via the given reporter. | |
Static Public Member Functions | |
| static List< KeyValuePair > | extractProperties (TargetConfig config) |
| Extract all properties as a list of key-value pairs from a TargetConfig. | |
| static TargetConfig | getMockInstance (Target target) |
| Return mock instance to use for testing, which is not tied to a generator context or a resource. | |
Public Attributes | |
| final List< String > | compileAdditionalSources = new ArrayList<>() |
| Additional sources to add to the compile command if appropriate. | |
| final Target | target |
| The target of this configuration (e.g., C, TypeScript, Python). | |
Static Public Attributes | |
| static final String | NOT_IN_LF_SYNTAX_MESSAGE |
| Error message to use when a target property does not exist in LF syntax. | |
Protected Member Functions | |
| void | load (JsonObject jsonObject, MessageReporter messageReporter) |
| Update this configuration based on the given JSON object. | |
| void | load (Resource resource, MessageReporter reporter) |
| Load configuration from the given resource. | |
Protected Attributes | |
| final Map< TargetProperty<?, ?>, KeyValuePair > | keyValuePairs = new HashMap<>() |
| Map from. | |
| Resource | mainResource |
| The main resource that is under compilation. | |
| final Map< TargetProperty<?, ?>, Object > | properties = new HashMap<>() |
| Map of target properties. | |
Package Functions | |
| public< T, S extends TargetPropertyType > T | get (TargetProperty< T, S > property) throws IllegalArgumentException |
| Return the value currently assigned to the given target property. | |
| public< T, S extends TargetPropertyType > T | getOrDefault (TargetProperty< T, S > property) |
| Return the value currently assigned to the given target property, or its default value if none been set. | |
| public< T, S extends TargetPropertyType > KeyValuePair | lookup (TargetProperty< T, S > targetProperty) |
| Return the AST node that was used to assign a value for the given target property. | |
| public< T, S extends TargetPropertyType > void | set (TargetProperty< T, S > property, T value) |
| Assign the given value to the given target property. | |
Subclass of TargetConfig with a specialized constructor for creating configurations for federates.
| org.lflang.federated.generator.FederateTargetConfig.FederateTargetConfig | ( | LFGeneratorContext | context, |
| Resource | federateResource ) |
Create a configuration for a federate given a main context and the resource in which the class of the federate is specified.
| context | The generator context. |
| federateResource | The resource in which to find the reactor class of the federate. |
|
staticinherited |
Extract all properties as a list of key-value pairs from a TargetConfig.
The returned list only includes properties that were explicitly set.
| config | The TargetConfig to extract from. |
|
inherited |
Construct a TargetDecl by extracting the fields of the given TargetConfig.
|
inherited |
Return the target property in this target config that matches the given string.
| name | The string to match against. |
|
packageinherited |
Return the value currently assigned to the given target property.
|
inherited |
Return the target properties that have been assigned a value.
|
inherited |
Get the main resource that is under compilation.
|
staticinherited |
Return mock instance to use for testing, which is not tied to a generator context or a resource.
|
packageinherited |
Return the value currently assigned to the given target property, or its default value if none been set.
| property | The property to get the value of |
| <T> | The Java type of the returned value. |
| <S> | The LF type of the returned value. |
|
inherited |
Return the target properties that are currently registered.
|
inherited |
Return whether this configuration is used in the context of a federated program.
|
inherited |
Return true if this target property has been set (past initialization), false otherwise.
|
inherited |
Return true if the given target property is supported, false otherwise.
|
inherited |
Return the target properties that are currently registered.
|
inherited |
Load overrides passed in as CLI arguments.
| args | List of overrides that may or may not be set |
| err | Message reporter to report attempts to set unsupported target properties. |
|
protectedinherited |
Update this configuration based on the given JSON object.
| jsonObject | The JSON object to read updates from. |
| messageReporter | A message reporter to report issues. |
|
protectedinherited |
Load configuration from the given resource.
| resource | A resource to load from. |
| reporter | A message reporter for reporting errors and warnings. |
|
inherited |
Return all the target properties that have been set.
|
packageinherited |
Return the AST node that was used to assign a value for the given target property.
| targetProperty | The target property to find a matching AST node for. |
| <T> | The Java type of values assigned to the given target property. |
| <S> | The LF type of values assigned to the given target property. |
|
inherited |
If the federate that the target configuration applies to is imported, merge target properties declared in the file that it was imported from.
| importedResource | The resource in which the target configuration is to be loaded from. |
| mainResource | The resource in which the main reactor is specified. |
| loadOrNot | Predicate to determine for each target property whether it should be loaded. |
| messageReporter | An error reporter to use when problems are encountered. |
|
inherited |
Register target properties and assign them their initial value.
| properties | The target properties to register. |
|
inherited |
Report that a target property is not supported by the current target.
| name | The name of the unsupported target property. |
| stage2 | The second stage an the error reporter through which to report the warning. |
|
inherited |
Reset this target property to its initial value (and mark it as unset).
|
packageinherited |
Assign the given value to the given target property.
| property | The target property to assign the value to. |
| value | The value to assign to the target property. |
| <T> | The Java type of the value. |
| <S> | The LF type of the value. |
|
inherited |
Return a description of the current settings.
|
inherited |
Update the given configuration using the given target properties.
| config | The configuration object to update. |
| pairs | AST node that holds all the target properties. |
| relativePath | The path from the main resource to the resource from which the new properties originate. |
| loadOrNot | Predicate to determine whether a property should be loaded. |
| err | Message reporter for errors. |
|
inherited |
Validate all set properties and report issues via the given reporter.
| reporter | A reporter to report errors and warnings through. |
|
inherited |
Additional sources to add to the compile command if appropriate.
|
protectedinherited |
Map from.
|
protectedinherited |
The main resource that is under compilation.
|
staticinherited |
Error message to use when a target property does not exist in LF syntax.
|
protectedinherited |
Map of target properties.
|
inherited |
The target of this configuration (e.g., C, TypeScript, Python).