Class LoadJsonLegacy
- java.lang.Object
-
- net.sourceforge.plantuml.tim.stdlib.SimpleReturnFunction
-
- net.sourceforge.plantuml.tim.stdlib.LoadJsonLegacy
-
- All Implemented Interfaces:
TFunction
public class LoadJsonLegacy extends SimpleReturnFunction
Loads JSON data from file or URL source.Supports three parameters for datasource, default JSON value and charset. The datasource will be checked against the security rules.
Examples:
@ startuml ' loads a local file !$JSON_LOCAL_RELATIVE=%loadJSON("file.json") ' loads a local file from an absolute file path !$JSON_LOCAL_ABS=%loadJSON("c:/loaded/data/file.json") ' tries to load a local file and returns an empty JSON !$JSON_LOCAL_REL_EMPTY=%loadJSON("file-not-existing.json") ' tries to load a local file and returns an default JSON !$DEF_JSON={"status":"No data found"} !$JSON_LOCAL_REL_DEF=%loadJSON("file-not-existing.json", $DEF_JSON) ' loads a local file with a specific charset (default is UTF-8) !$JSON_LOCAL_RELATIVE_CHARSET=%loadJSON("file.json", "{}", "iso-8859-1") ' loads a remote JSON from an endpoint (and default, if not reachable) !$STATUS_NO_CONNECTION={"status": "No connection"} !$JSON_REMOTE_DEF=%loadJSON("https://localhost:7778/management/health", $STATUS_NO_CONNECTION) status -> $JSON_REMOTE_DEF.status @ enduml
- Author:
- Aljoscha Rittner
-
-
Constructor Summary
Constructors Constructor Description LoadJsonLegacy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canCover(int nbArg, Set<String> namedArgument)
TValue
executeReturnFunction(TContext context, TMemory memory, LineLocation location, List<TValue> values, Map<String,TValue> named)
TFunctionSignature
getSignature()
-
Methods inherited from class net.sourceforge.plantuml.tim.stdlib.SimpleReturnFunction
executeProcedure, executeProcedureInternal, getFunctionType, isUnquoted
-
-
-
-
Method Detail
-
getSignature
public TFunctionSignature getSignature()
-
executeReturnFunction
public TValue executeReturnFunction(TContext context, TMemory memory, LineLocation location, List<TValue> values, Map<String,TValue> named) throws EaterException, EaterExceptionLocated
- Throws:
EaterException
EaterExceptionLocated
-
-