/** * Returns the system property which corresponds to the given key. * * @param key system property key * @return system property as a {@link BValue} or {@code BTypes.typeString.getZeroValue()} if the property does not * exist. */ public static BValue getSystemProperty(String key) { String value = System.getProperty(key); if (value == null) { return BTypes.typeString.getZeroValue(); } return new BString(value); }
/** * Returns the system property which corresponds to the given key. * * @param key system property key * @return system property as a {@link BValue} or {@code BTypes.typeString.getZeroValue()} if the property does not * exist. */ public static BValue getSystemProperty(String key) { String value = System.getProperty(key); if (value == null) { return BTypes.typeString.getZeroValue(); } return new BString(value); } }
/** * Returns the system property which corresponds to the given key. * * @param key system property key * @return system property as a {@link BValue} or {@code BTypes.typeString.getZeroValue()} if the property does not * exist. */ public static BValue getSystemProperty(String key) { String value = System.getProperty(key); if (value == null) { return BTypes.typeString.getZeroValue(); } return new BString(value); } }
/** * {@inheritDoc} */ @Override public BString getTextValue() { switch(nodeType) { case ELEMENT: StringBuilder elementTextBuilder = new StringBuilder(); Iterator<OMNode> children = ((OMElement) omNode).getChildren(); while (children.hasNext()) { elementTextBuilder.append(getTextValue(children.next())); } return new BString(elementTextBuilder.toString()); case TEXT: return new BString(((OMText) omNode).getText()); case COMMENT: return BTypes.typeString.getZeroValue(); case PI: return BTypes.typeString.getZeroValue(); default: return BTypes.typeString.getZeroValue(); } }
@Override public void execute(Context context) { String str = context.getStringArgument(0); String value = System.getenv(str); if (value == null) { context.setReturnValues(BTypes.typeString.getZeroValue()); return; } context.setReturnValues(new BString(value)); } }
/** * {@inheritDoc} */ @Override public BString getElementName() { if (sequence.size() == 1) { return ((BXMLItem) sequence.getRefValue(0)).getElementName(); } return BTypes.typeString.getZeroValue(); }
Arrays.fill(refValues, arrayType.getElementType().getZeroValue()); } else if (type.getTag() == TypeTags.TUPLE_TAG) { BTupleType tupleType = (BTupleType) type;
bStruct.put(fieldName, fieldType.getZeroValue()); continue;
bStruct.put(key, fieldType.getZeroValue()); continue;