/* (non-Javadoc)
@see com.ibm.ws.sib.admin.JsAdminService#quoteJmxPropertyValue(java.lang.String)
423149
public String quoteJmxPropertyValue(String s) {
    if (JsAdminService.isValidJmxPropertyValue(s) == true)
      return s;
    else
      return ObjectName.quote(s);
  }
542500
private static void setValue(Object obj, String propertyPattern, Object value, ObjectWrapper options) {
        if (propertyPattern == null) {
            throw new IllegalArgumentException("Cannot set a new value to a property with a 'null' propertyPattern.");
        }

        if (obj == null) {
            // NullPointerException as it is throwed only when traversing a null object (ex: "foo.null.bar")
            throw new NullPointerException("Cannot set the value of '" + propertyPattern + "' to a 'null' object.");
        }

        // '.' position if positive, '[' inverse position if negative
        int position = indexOfDotOrSquare(propertyPattern);

        // (propertyPattern.contains("."))
        if (position > 0) {
            String leftPattern = propertyPattern.substring(0, position);
            String rightPattern = propertyPattern.substring(position + 1, propertyPattern.length());
            Object leftValue = getValue(obj, leftPattern, options);

            if (leftValue == null) {
                Property leftProperty = getPropertyOrThrow(Bean.forClass(obj.getClass()), leftPattern);

                if (options.isAutoInstancing) {
                    try {
                        leftValue = leftProperty.getType().newInstance();
                    } catch (Exception e) {
                        throw new ReflectionException("The value of " + leftProperty + " was 'null' in the object "
                                                              + obj.getClass().getName() + ". An attempt to invoke its 'no-args constructor'" +
                                                              " was made, but an error occurs.", e);
                    }

                    leftProperty.set(obj, leftValue);
                }
            }

            setValue(leftValue, rightPattern, value, options);
            // if (propertyPattern.contains("["))
        } else if (position < 0) {
            int squarePosition = -position;

            String leftPattern = propertyPattern.substring(0, squarePosition);
            String indexOrKey = propertyPattern.substring(squarePosition + 1, propertyPattern.length() - 1);// removes ']'
            Property leftProperty = getPropertyOrThrow(Bean.forClass(obj.getClass()), leftPattern);

            if (leftProperty.getType().isAssignableFrom(Map.class)) {
                setMappedValue(obj, leftProperty, indexOrKey, value, options);
            } else {
                try {
                    setIndexedValue(obj, leftProperty, Integer.parseInt(indexOrKey), value, options);
                } catch (NumberFormatException e) {
                    throw new IllegalArgumentException("The pattern '" + indexOrKey + "' for the indexed "
                                                               + leftProperty + " is invalid. Cannot parse the string to a valid integer index.");
                }
            }
        } else {
            setSimpleValue(obj, getPropertyOrThrow(Bean.forClass(obj.getClass()), propertyPattern), value);
        }
    }
808203
private String readQuote( char quote ) {
        StringBuilder builder = cachesBuilder;
        builder.setLength( 0 );
        readQuote( quote, builder );
        String str = builder.toString();
        builder.setLength( 0 );
        return str;
    }
737884
private static <L extends Annotation> String defineWhereStatement(final SQLiteModelMethod method, final JQL jql, Class<L> annotation, Map<JQLDynamicStatementType, String> dynamicReplace) {
		StringBuilder builder = new StringBuilder();

		String where = AnnotationUtility.extractAsString(method.getElement(), annotation, AnnotationAttributeType.WHERE);
		if (StringUtils.hasText(where))
			jql.annotatedWhere = true;

		if (StringUtils.hasText(where) || method.hasDynamicWhereConditions()) {
			builder.append(" " + WHERE_KEYWORD);

			if (StringUtils.hasText(where)) {
				jql.staticWhereConditions = true;
				builder.append(StringUtils.startWithSpace(where));
			}

			if (StringUtils.hasText(method.dynamicWhereParameterName)) {
				StringBuilder dynamicBuffer = new StringBuilder();
				dynamicBuffer.append(" #{" + JQLDynamicStatementType.DYNAMIC_WHERE + "}");
				builder.append(" #{" + JQLDynamicStatementType.DYNAMIC_WHERE + "}");

				// define replacement string for WHERE
				dynamicReplace.put(JQLDynamicStatementType.DYNAMIC_WHERE, dynamicBuffer.toString());
			}

		}

		return builder.toString();
	}
49600
public static boolean hasPropertyPrefix(String propertyValue) {

        return (propertyValue != null)
            && (propertyValue.startsWith(DYNAMIC_TEMPLATE_PREFIX)
                || propertyValue.startsWith(DYNAMIC_TEMPLATE_LEGACY_PREFIX));
    }
835089
@Override
	public final void setObjectProperty(String name, Object value) throws JMSException
    {
        if (value == null)
            throw new MessageFormatException("A property value cannot be null");
            
        // Check type
        if (!(value instanceof Boolean ||
              value instanceof Byte ||
              value instanceof Short ||
              value instanceof Integer ||
              value instanceof Long ||
              value instanceof Float ||
              value instanceof Double ||
              value instanceof String))
            throw new MessageFormatException("Unsupported property value type : "+value.getClass().getName());
        
        setProperty(name,value);
    }
601980
public JsonNode getPropertyValue(final JsiiObjectRef objRef, final String property) {
        ObjectNode req = makeRequest("get", objRef);
        req.put("property", property);

        return this.runtime.requestResponse(req).get("value");
    }
727812
public static void setProperty(String propertyName, String propertyValue) {
		try {
			FreeMarkerRender.getConfiguration().setSetting(propertyName, propertyValue);
		} catch (TemplateException e) {
			throw new RuntimeException(e);
		}
	}
821016
@Override
    public final void setObjectProperty(String name, Object value) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setObjectProperty", new Object[] { name, value });

        /* If the property is either JMSXUserID or JMSXAppID, we set it into the */
        /* message regardless of whether it is null. We know the value is a */
        /* String as the JMS API layer has vetted it. Moved code under d325186.1 */
        if (SIProperties.JMSXAppID.equals(name)) {
            setJmsxAppId((String) value);
        }
        else if (SIProperties.JMSXUserID.equals(name)) {
            setUserid((String) value);
        }
        /* Ditto for JMS_IBM_ArmCorrelator & JMS_TOG_ARM_Correlator */
        else if (SIProperties.JMS_IBM_ArmCorrelator.equals(name)) {
            setARMCorrelator((String) value);
        }
        else if (SIProperties.JMS_TOG_ARM_Correlator.equals(name)) {
            setARMCorrelator((String) value);
        }

        /* else, if the value is not null, set the Property */
        else if (value != null) {
            setNonNullProperty(name, value);
        }

        /* Otherwise, remove it */
        else {

            /* Maelstrom's transportVersion has its own field - the rest are in the */
            /* JmsPropertyMap */
            if (!name.startsWith(JMS_PREFIX)) {
                if (name.equals(MfpConstants.PRP_TRANSVER)) {
                    clearTransportVersion();
                }
                else {
                    if (mayHaveJmsUserProperties()) {
                        getJmsUserPropertyMap().remove(name);
                    }
                }
            }
            else {
                if (name.startsWith(JMS_IBM_MQMD_PREFIX)) {
                    deleteMQMDProperty(name);
                }
                else {
                    if (mayHaveMappedJmsSystemProperties()) {
                        getJmsSystemPropertyMap().remove(name); // 234893
                    }
                    // JMS_IBM_Character_Set and JMS_IBM_Encoding need to be cleared in the
                    // message itself too.                                          d395685
                    if (name.equals(SIProperties.JMS_IBM_Character_Set)) {
                        setCcsid(null);
                    }
                    else if (name.equals(SIProperties.JMS_IBM_Encoding)) {
                        setEncoding(null);
                    }
                }
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setObjectProperty");
    }
476130
static protected String quote(final String value)
    {
        final StringBuilder out = new StringBuilder();
        AbstractCLA.uncompileQuoter(out, value);
        return out.toString();
    }
675329
private void doJmxValue(HttpServletResponse httpResponse, String jmxValueParameter)
			throws IOException {
		httpResponse.setContentType("text/plain");
		httpResponse.getWriter().write(MBeans.getConvertedAttributes(jmxValueParameter));
		httpResponse.flushBuffer();
	}
1237633
Object decodeProperty(MsgDestEncodingUtilsImpl.PropertyInputStream stream) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "decodeProperty", stream);

    // Get the String value in the normal way, then turn it into an Integer
    String temp = (String)super.decodeProperty(stream);
    Integer value = Integer.valueOf(temp);

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "decodeProperty", value);
    return value;
  }
674924
void encodeProperty(ByteArrayOutputStream baos, Object value) throws JMSException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "encodeProperty", new Object[]{baos, value});

    // The value should be a non-null String
    if (value instanceof String) {

      baos.write(encodedName, 0, encodedName.length);            // Write out the encoded tname

      String strVal = (String)value;
      int len = Utf8Codec.getEncodedLength(strVal);
      byte[] buffer = new byte[len + ArrayUtil.SHORT_SIZE];     // bytes for the value length & the value itself
      ArrayUtil.writeShort(buffer, 0, (short)len);              // Encode in the length of the String value
      Utf8Codec.encode(buffer, ArrayUtil.SHORT_SIZE, strVal); // Encode in the String value itself

      baos.write(buffer, 0, buffer.length);                     // Write the encode value to the buffer
    }

    // If it is not a String, something has gone horribly wrong
    else {
      throw (JMSException)JmsErrorUtils.newThrowable(JMSException.class
                                                    ,"INTERNAL_ERROR_CWSIA0362"
                                                    ,new Object[] {"ShortStringPropertyCoder.encodeProperty#1", longName, value}
                                                    ,null
                                                    ,"ShortStringPropertyCoder.encodeProperty#1"
                                                    ,null
                                                    ,tc);
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "encodeProperty");
  }
1367833
private char retrieveWrappingQuoteTypeOfJsonMemberNames(String jsonString) {
        char quote = '\"';   //  the default quote character used to specify json member names and string value according to the json specification
        for (char c : jsonString.toCharArray()) {
            if (c == '\'' || c == '\"') {
                quote = c;
                break;
            }
        }
        return quote;
    }
1348742
public final BELScriptParser.quoted_value_return quoted_value() throws RecognitionException {
        BELScriptParser.quoted_value_return retval = new BELScriptParser.quoted_value_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token qv=null;

        Object qv_tree=null;

        try {
            // BELScript.g:114:5: (qv= QUOTED_VALUE )
            // BELScript.g:114:7: qv= QUOTED_VALUE
            {
            root_0 = (Object)adaptor.nil();

            qv=(Token)match(input,QUOTED_VALUE,FOLLOW_QUOTED_VALUE_in_quoted_value543); 
            qv_tree = (Object)adaptor.create(qv);
            adaptor.addChild(root_0, qv_tree);


                    // https://github.com/OpenBEL/openbel-framework/issues/14
                    qv.setText(qv.getText().replace("\\\\", "\\"));
                

            }

            retval.stop = input.LT(-1);

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
691439
@Override
	public final void setDoubleProperty(String name, double value) throws JMSException
    {
        setProperty(name,new Double(value));
    }
345002
public JcString stringProperty(String name) {
		JcString ret = new JcString(name, this, OPERATOR.PropertyContainer.PROPERTY_ACCESS);
		QueryRecorder.recordInvocationConditional(this, "stringProperty", ret, QueryRecorder.literal(name));
		return ret;
	}