public StringValue(String value) { if (value == null) { throw new IllegalArgumentException("Error initializing StringValue class. Parameter \"value\" can't be null."); } this.value = value; metaInfo = new ValueMetaInfo(); }
public void setFullName(String name) { if (metaInfo == null) { metaInfo = new ValueMetaInfo(); } if (metaInfo instanceof ValueMetaInfo) { ((ValueMetaInfo) metaInfo).setFullName(name); } }
public void setName(String name) { if (metaInfo == null) { metaInfo = new ValueMetaInfo(); } if (metaInfo instanceof ValueMetaInfo) { ((ValueMetaInfo) metaInfo).setShortName(name); } }
private static void setMetaInfo(IMetaHolder holder, ILogicalTable cell, String paramName, String ruleName, IBindingContext bindingContext) { if (!bindingContext.isExecutionMode()) { ValueMetaInfo valueMetaInfo = new ValueMetaInfo(); valueMetaInfo.setShortName(paramName); valueMetaInfo.setFullName(ruleName == null ? paramName : ruleName + "." + paramName); valueMetaInfo.setSource(new GridCellSourceCodeModule(cell.getSource(), bindingContext)); holder.setMetaInfo(valueMetaInfo); } }
public IOpenSourceCodeModule asSourceCodeModule() { return new StringSourceCodeModule(value, getMetaInfo().getSourceUrl()); }
@Override public Object convert(List<AlgorithmTreeNode> nodesToCompile, String operationParam) throws SyntaxNodeException { if (operationParam == null) { return null; } StringValue cellContent = AlgorithmCompilerTool.getCellContent(nodesToCompile, operationParam); AlgorithmTreeNode executionNode = AlgorithmCompilerTool.extractOperationNode(nodesToCompile, operationParam); String methodName = String.format("%s_row_%s", operationParam.replace('.', '_'), executionNode.getAlgorithmRow().getRowNumber()); IOpenSourceCodeModule src = cellContent.getMetaInfo().getSource(); // return statements for the whole Algorithm(TBasic) should be casted to the return type of // whole Algorithm rule if (labelManager.isReturnInstruction(operationParam)) { /** create method and cast its value to the appropriate return type*/ return compiler.makeMethodWithCast(src, methodName, returnType); } else { return compiler.makeMethod(src, methodName); } } }
public IOpenSourceCodeModule asSourceCodeModule() { return new StringSourceCodeModule(value, getMetaInfo().getSourceUrl()); }
private CellMetaInfo checkMetaInfo(int row, int col, RuntimeOperation step, StringValue algorithmCell) { IOpenSourceCodeModule sourceModule = algorithmCell.getMetaInfo().getSource(); if (sourceModule instanceof GridCellSourceCodeModule) { ICell cell = ((GridCellSourceCodeModule) sourceModule).getCell(); if (isNeededCell(cell, row, col)) { // Found the cell. Return either meta info or null. if (step instanceof OpenLEvaluationOperation) { IMethodCaller methodCaller = ((OpenLEvaluationOperation) step).getOpenLStatement(); if (methodCaller instanceof CompositeMethod) { List<NodeUsage> nodeUsages = OpenLCellExpressionsCompiler.getNodeUsages( (CompositeMethod) methodCaller, sourceModule.getCode(), 0 ); return new CellMetaInfo(JavaOpenClass.STRING, false, nodeUsages); } } return null; } } return NOT_FOUND; } }
public StringValue(String value, String shortName, String fullName, IOpenSourceCodeModule source) { if (value == null) { throw new IllegalArgumentException("Error initializing StringValue class. Parameter \"value\" can't be null."); } this.value = value; metaInfo = new ValueMetaInfo(shortName, fullName, source); }
public void setFullName(String name) { if (metaInfo == null) { metaInfo = new ValueMetaInfo(); } if (metaInfo instanceof ValueMetaInfo) { ((ValueMetaInfo) metaInfo).setFullName(name); } }
public void setName(String name) { if (metaInfo == null) { metaInfo = new ValueMetaInfo(); } if (metaInfo instanceof ValueMetaInfo) { ((ValueMetaInfo) metaInfo).setShortName(name); } }
public ObjectValue(Object value) { if (value == null) { throw new IllegalArgumentException("Error initializing ObjectValue class. Parameter \"value\" can't be null."); } this.value = value; metaInfo = new ValueMetaInfo(); }
public ObjectValue(Object value) { if (value == null) { throw new IllegalArgumentException("Error initializing ObjectValue class. Parameter \"value\" can't be null."); } this.value = value; metaInfo = new ValueMetaInfo(); }
public ObjectValue(Object value, String shortName, String fullName, IOpenSourceCodeModule source) { if (value == null) { throw new IllegalArgumentException("Error initializing ObjectValue class. Parameter \"value\" can't be null."); } this.value = value; metaInfo = new ValueMetaInfo(shortName, fullName, source); }
public ObjectValue(Object value, String shortName, String fullName, IOpenSourceCodeModule source) { if (value == null) { throw new IllegalArgumentException("Error initializing ObjectValue class. Parameter \"value\" can't be null."); } this.value = value; metaInfo = new ValueMetaInfo(shortName, fullName, source); }
public StringValue(String value) { if (value == null) { throw new IllegalArgumentException("Error initializing StringValue class. Parameter \"value\" can't be null."); } this.value = value; metaInfo = new ValueMetaInfo(); }
public StringValue(String value, String shortName, String fullName, IOpenSourceCodeModule source) { if (value == null) { throw new IllegalArgumentException("Error initializing StringValue class. Parameter \"value\" can't be null."); } this.value = value; metaInfo = new ValueMetaInfo(shortName, fullName, source); }
/** * Sets the metainfo for the value */ public void setMetaInfo(IMetaInfo metaInfo) { if (metaInfo instanceof ValueMetaInfo) { setMetaInfo((ValueMetaInfo) metaInfo); } else { try { ValueMetaInfo valueMetaInfo = new ValueMetaInfo(metaInfo.getDisplayName(IMetaInfo.SHORT), metaInfo.getDisplayName(IMetaInfo.LONG), new URLSourceCodeModule(new URL(metaInfo.getSourceUrl()))); setMetaInfo(valueMetaInfo); } catch (Exception e) { log.debug("Failed to set meta info for StringValue \"{}\"", value, e); setMetaInfo((ValueMetaInfo) null); } } }
/** * Sets the metainfo for the value */ public void setMetaInfo(IMetaInfo metaInfo) { if (metaInfo instanceof ValueMetaInfo) { setMetaInfo((ValueMetaInfo) metaInfo); } else { try { ValueMetaInfo valueMetaInfo = new ValueMetaInfo(metaInfo.getDisplayName(IMetaInfo.SHORT), metaInfo.getDisplayName(IMetaInfo.LONG), new URLSourceCodeModule(new URL(metaInfo.getSourceUrl()))); setMetaInfo(valueMetaInfo); } catch (Exception e) { log.debug("Failed to set meta info for StringValue \"{}\"", value, e); setMetaInfo((ValueMetaInfo) null); } } }
IMetaInfo meta = new ValueMetaInfo(name, null, source); ((IMetaHolder) result).setMetaInfo(meta);