java.lang.Object
org.praxislive.project.ProjectModel
Model for project scripts. Project scripts are a series of commands or file
includes, split into three sections - setup, build and run.
The setup section normally consists of commands to configure the hub, libraries, compiler, etc.
The build section normally consists of includes for the various root graph files.
The run section normally includes lines to start the various roots. Unlike the other two sections, elements in the run section should usually support repeated execution.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionImmutable list of the elements in the build section.static ProjectModel.Builderbuilder()Create a project model builder.context()Access the optional context (eg. working dir) for resolving relative file values.booleaninthashCode()static ProjectModelParse the given project script into a project model.static ProjectModelParse the given project script and context into a project model.Immutable list of the elements in the run section.Immutable list of the elements in the setup section.toString()withContext(URI context) Create a new project model with a different context.voidwrite(Appendable target) Write the model as a script to the given target.Write the project model to a String.
-
Method Details
-
setupElements
Immutable list of the elements in the setup section.- Returns:
- setup elements
-
buildElements
Immutable list of the elements in the build section.- Returns:
- build elements
-
runElements
Immutable list of the elements in the run section.- Returns:
- run elements
-
context
Access the optional context (eg. working dir) for resolving relative file values.- Returns:
- optional context
-
withContext
Create a new project model with a different context. The context is used to relativize resources when writing. Usenullto create a model without context.- Parameters:
context- new resource context- Returns:
- new graph model
-
write
Write the model as a script to the given target.- Parameters:
target- write destination- Throws:
IOException
-
writeToString
Write the project model to a String. This is shorthand for passing in aStringBuildertowrite(java.lang.Appendable).The output of this method is suitable for parsing back into a model, as distinct from the output of
toString().- Returns:
- model as script
-
equals
-
hashCode
public int hashCode() -
toString
-
builder
Create a project model builder.- Returns:
- builder
-
parse
Parse the given project script into a project model.- Parameters:
script- project script- Returns:
- model
- Throws:
ParseException- if script is not a valid project
-
parse
Parse the given project script and context into a project model. Relative includes will be parsed against the provided context.- Parameters:
context- project contextscript- project script- Returns:
- model
- Throws:
ParseException- if script is not a valid project
-