This method replaces place holders embedded in the given value
by either meta parameter or XPath expression operated on the
given XML Bean. Meta parameter is identified by a "$" followed
by the parameter name.
@param value
@param metainfo
@return
9412
protected String placeHolderTranslation(String value,
            Map<String,String> metainfo, XmlObject xmlbean) {
        int k, i, n;
        StringBuffer sb = new StringBuffer();
        n = value.length();
        for (i=0; i<n; i++) {
            char ch = value.charAt(i);
            if (ch=='{') {
                k = i+1;
                while (k<n) {
                    ch = value.charAt(k);
                    if (ch=='}') break;
                    k++;
                }
                if (k<n) {
                    String placeHolder = value.substring(i+1,k);
                    String v;
                    if (placeHolder.charAt(0)=='$') {
                        v = metainfo.get(placeHolder.substring(1));
                    } else {        // assume is an XPath expression
                        v = XmlPath.evaluate(xmlbean, placeHolder);
                    }
                    if (v!=null) sb.append(v);
                } // else  '{' without '}' - ignore string after '{'
                i = k;
            } else sb.append(ch);
        }
        return sb.toString();
    }
507702
public AnnotatedTextBuilder addGlobalMetaData(AnnotatedText.MetaDataKey key, String value) {
    metaData.put(key, value);
    return this;
  }
898874
@XmlElementDecl(namespace = "http://requestinfo.development.soap.services.server.exampleproject.anythingworks.optimaize.com/", name = "requestInfo")
    public JAXBElement<RequestInfo> createRequestInfo(RequestInfo value) {
        return new JAXBElement<RequestInfo>(_RequestInfo_QNAME, RequestInfo.class, null, value);
    }
670194
private static CmsRelationType valueOfInternal(String name) {

        if (name != null) {
            String valueUp = name.toUpperCase();
            for (int i = 0; i < VALUE_ARRAY.length; i++) {
                if (valueUp.equals(VALUE_ARRAY[i].m_name)) {
                    return VALUE_ARRAY[i];
                }
            }
            // deprecated types
            if (valueUp.equals("REFERENCE") || valueUp.equals("XML_REFERENCE")) {
                return XML_WEAK;
            } else if (valueUp.equals("ATTACHMENT") || valueUp.equals("XML_ATTACHMENT")) {
                return XML_STRONG;
            }
            // user defined
            for (int i = 0; i < getAllUserDefined().size(); i++) {
                CmsRelationType type = getAllUserDefined().get(i);
                if (valueUp.equals(type.m_name)) {
                    return type;
                }
            }
        }
        return null;
    }
555076
public String replaceAllInWith(String regEx, String value, String replace) {
        String result = null;
        if (value != null) {
            if (replace == null) {
                // empty cell in table is sent as null
                replace = "";
            }
            result = getMatcher(regEx, value).replaceAll(replace);
        }
        return result;
    }
1330192
public <S,T> Modify<S> getInverse( T value ) {
        ModifyLiteral inverse = new InverseModifyLiteral( value );
        ModifyTaskLiteral task = this.task;
        do {
            if ( isAffected( value, task.value ) ) {
                MetaProperty inv = ( (InvertibleMetaProperty) task.getProperty() ).getInverse();
                inverse.addTask( inv,
                                 inv.isManyValued() ? Collections.singleton( getTarget() ) : getTarget(),
                                 task.mode == Lit.REMOVE ? Lit.REMOVE : Lit.ADD ) ;

            }
            task = task.nextTask;
        } while ( task != null );
        return inverse;
    }
599339
public XmlStringBuilder attribute(String name, String value) {
        assert value != null;
        sb.append(' ').append(name).append("='");
        escapeAttributeValue(value);
        sb.append('\'');
        return this;
    }
40297
HtmlTag attr(String name, String value) {
        if (attrs == null) {
            attrs = new HashMap<>();
        }
        attrs.put(name, value);
        return this;
    }
482556
public XmlStringBuilder optIntAttribute(String name, int value) {
        if (value >= 0) {
            attribute(name, Integer.toString(value));
        }
        return this;
    }
641352
function(name, value, metaName) {
            if (_.isObject(name)) {
                _.each(name, function(value, name) {
                    this.meta(name, value);
                }, this);
                return;
            }

            if (metaName == null) metaName = "name";
            var mt = this.$('meta['+metaName+'="'+name+'"]');
            if (mt.length === 0) {
                mt =  $("<meta>", {}).attr(metaName, name).appendTo('head');
            }
            if (value != null) {
                mt.attr('content', value);
                return this;
            } else {
                return mt.attr('content');
            }
        }
766418
@Override
    public BeanBuilder<T> set(String propertyName, Object value) {
        return set(getMetaBean().metaProperty(propertyName), value);
    }
937341
public static String getExactlyValue(final String value) {
        return null == value ? null : CharMatcher.anyOf("[]`'\"").removeFrom(value);
    }
1116376
private <T extends XSString> T createXSString(Class<T> clazz, String value) {
    if (value == null) {
      return null;
    }
    QName elementName = null;
    String localName = null;
    try {
      elementName = (QName) clazz.getDeclaredField("DEFAULT_ELEMENT_NAME").get(null);
      localName = (String) clazz.getDeclaredField("DEFAULT_ELEMENT_LOCAL_NAME").get(null);
    }
    catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException | SecurityException e) {
      throw new RuntimeException(e);
    }
    XMLObjectBuilder<? extends XMLObject> builder = XMLObjectProviderRegistrySupport.getBuilderFactory().getBuilder(elementName);
    Object object = builder.buildObject(new QName(this.getElementQName().getNamespaceURI(), localName, this.getElementQName().getPrefix()));
    T xsstring = clazz.cast(object);
    xsstring.setValue(value);
    return xsstring;
  }
1283046
private void appendValue(Object value) {
        if (value instanceof Boolean) {
            closeTag();
            append(value.toString());
        } else if (value instanceof Number) {
            closeTag();
            append(value.toString());
        } else if (value instanceof String) {
            closeTag();
            escape((String) value);
        } else if (value instanceof MwsObject) {
            ((MwsObject) value).writeFragmentTo(this);
        } else if (value instanceof Node) {
            closeTag();
            append(MwsUtl.toXmlString((Node) value));
        } else if (value instanceof Enum) {
            closeTag();
            append(((Enum<?>) value).toString());
        } else if (value instanceof XMLGregorianCalendar) {
            closeTag();
            append(((XMLGregorianCalendar) value).toXMLFormat());
        } else {
            throw new IllegalArgumentException();
        }
    }
120296
private static String replaceProperties(final String value) {
        final StringBuilder builder = new StringBuilder();
        final int len = value.length();
        int state = 0;
        int start = -1;
        int nameStart = -1;
        for (int i = 0; i < len; i = value.offsetByCodePoints(i, 1)) {
            final char ch = value.charAt(i);
            switch (state) {
                case INITIAL: {
                    switch (ch) {
                        case '$': {
                            state = GOT_DOLLAR;
                            continue;
                        }
                        default: {
                            builder.append(ch);
                            continue;
                        }
                    }
                    // not reachable
                }
                case GOT_DOLLAR: {
                    switch (ch) {
                        case '$': {
                            builder.append(ch);
                            state = INITIAL;
                            continue;
                        }
                        case '{': {
                            start = i + 1;
                            nameStart = start;
                            state = GOT_OPEN_BRACE;
                            continue;
                        }
                        default: {
                            // invalid; emit and resume
                            builder.append('$').append(ch);
                            state = INITIAL;
                            continue;
                        }
                    }
                    // not reachable
                }
                case GOT_OPEN_BRACE: {
                    switch (ch) {
                        case ':':
                        case '}':
                        case ',': {
                            final String name = value.substring(nameStart, i).trim();
                            if ("/".equals(name)) {
                                builder.append('/');
                                state = ch == '}' ? INITIAL : RESOLVED;
                                continue;
                            } else if (":".equals(name)) {
                                builder.append('/');
                                state = ch == '}' ? INITIAL : RESOLVED;
                                continue;
                            }
                            final String val = null;//System.getProperty(name);
                            if (val != null) {
                                builder.append(val);
                                state = ch == '}' ? INITIAL : RESOLVED;
                                continue;
                            } else if (ch == ',') {
                                nameStart = i + 1;
                                continue;
                            } else if (ch == ':') {
                                start = i + 1;
                                state = DEFAULT;
                                continue;
                            } else {
                                builder.append(value.substring(start - 2, i + 1));
                                state = INITIAL;
                                continue;
                            }
                        }
                        default: {
                            continue;
                        }
                    }
                    // not reachable
                }
                case RESOLVED: {
                    if (ch == '}') {
                        state = INITIAL;
                    }
                    continue;
                }
                case DEFAULT: {
                    if (ch == '}') {
                        state = INITIAL;
                        builder.append(value.substring(start, i));
                    }
                    continue;
                }
                default: throw new IllegalStateException();
            }
        }
        switch (state) {
            case GOT_DOLLAR: {
                builder.append('$');
                break;
            }
            case DEFAULT:
            case GOT_OPEN_BRACE: {
                builder.append(value.substring(start - 2));
                break;
            }
        }
        return builder.toString();
    }
980189
public static CmsSearchFieldMappingType valueOf(String value) {

        if (CmsStringUtil.isEmptyOrWhitespaceOnly(value)) {
            return null;
        }
        value = value.trim().toLowerCase();
        if (STR_CONTENT.equals(value)) {
            return CONTENT;
        } else if (STR_PROPERTY.equals(value)) {
            return PROPERTY;
        } else if (STR_PROPERTY_SEARCH.equals(value)) {
            return PROPERTY_SEARCH;
        } else if (STR_ITEM.equals(value)) {
            return ITEM;
        } else if (STR_DYNAMIC.equals(value)) {
            return DYNAMIC;
        } else if (STR_ATTRIBUTE.equals(value)) {
            return ATTRIBUTE;
        }
        return null;
    }
382688
private String metadataValueOf(String value) {
        if (value == null || value.trim().isEmpty())
            return null;
        return value;
    }