From 06f8a6eebb66f2cd65b727c16ba8f5699ffb694a Mon Sep 17 00:00:00 2001 From: Gabriele Manduchi Date: Fri, 3 Mar 2023 09:43:43 +0100 Subject: [PATCH] Add context information also to partameter help, units and validation --- .../src/main/java/MDSplus/Data.java | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/java/mdsobjects/src/main/java/MDSplus/Data.java b/java/mdsobjects/src/main/java/MDSplus/Data.java index 7749d6ec32..9a8ab19b85 100644 --- a/java/mdsobjects/src/main/java/MDSplus/Data.java +++ b/java/mdsobjects/src/main/java/MDSplus/Data.java @@ -121,6 +121,10 @@ public double[] toDouble() throws Exception public void setCtxTree(Tree ctxTree) { this.ctxTree = ctxTree; } + public Tree getCtxTree() + { + return ctxTree; + } static { try @@ -465,25 +469,41 @@ public int getSizeInBytes() * Return units field. EmptyData is returned if no units defined. */ public Data getUnits() - { return units; } + { + if(units != null) + units.setCtxTree(ctxTree); + return units; + } /** * Returns help). Returns EmptyData if no help field defined. */ public Data getHelp() - { return help; } + { + if(help != null) + help.setCtxTree(ctxTree); + return help; + } /** * Get the error field. Returns EmptyData if no error defined. */ public Data getError() - { return error; } + { + if(error != null) + error.setCtxTree(ctxTree); + return error; + } /** * Get the error field. Returns EmptyData if no error defined. */ public Data getValidation() - { return validation; } + { + if(validation != null) + validation.setCtxTree(ctxTree); + return validation; + } /** *