Examples of StringValue


Examples of SmartGen.StringValue

        if (result == null) result = caseConfigurableElement(value);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case SmartGenPackage.STRING_VALUE: {
        StringValue stringValue = (StringValue)theEObject;
        Object result = caseStringValue(stringValue);
        if (result == null) result = caseValue(stringValue);
        if (result == null) result = caseConfigurableElement(stringValue);
        if (result == null) result = defaultCase(theEObject);
        return result;
View Full Code Here

Examples of at.bestsolution.efxclipse.tooling.fxgraph.fXGraph.StringValue

                    if ((_value_16 instanceof ResourceValueProperty)) {
                      String _name_7 = p.getName();
                      String _plus_28 = (" " + _name_7);
                      String _plus_29 = (_plus_28 + "=\"%");
                      ValueProperty _value_17 = p.getValue();
                      StringValue _value_18 = ((ResourceValueProperty) _value_17).getValue();
                      String _value_19 = _value_18.getValue();
                      String _plus_30 = (_plus_29 + _value_19);
                      String _plus_31 = (_plus_30 + "\"");
                      builder.append(_plus_31);
                    } else {
                      ValueProperty _value_20 = p.getValue();
View Full Code Here

Examples of client.net.sf.saxon.ce.value.StringValue

            case GENERATE_ID:
                FastStringBuffer buffer = new FastStringBuffer(FastStringBuffer.TINY);
                node.generateId(buffer);
                buffer.condense();
                return new StringValue(buffer);

            case DOCUMENT_URI:
                // If the node is in the document pool, get the URI under which it is registered.
                // Otherwise, return its systemId.
                return getDocumentURI(node, c);
            case NODE_NAME:
                int nc = node.getNameCode();
                if (nc == -1) {
                    return null;
                }
                return new QNameValue(node.getNamePool(), nc);
            default:
                throw new UnsupportedOperationException("Unknown name operation");
        }
        return new StringValue(s);
    }
View Full Code Here

Examples of client.net.sf.saxon.ce.value.StringValue

   /**
     * Evaluate the function
     */

    public Item evaluateItem(XPathContext context) throws XPathException {
        StringValue arg1 = (StringValue)argument[1].evaluateItem(context);
        if (arg1==null || arg1.isZeroLength()) {
            return StringValue.EMPTY_STRING;
        }

        StringValue arg0 = (StringValue)argument[0].evaluateItem(context);
        if (arg0==null || arg0.isZeroLength()) {
            return StringValue.EMPTY_STRING;
        }

        String s0 = arg0.getStringValue();
        String s1 = arg1.getStringValue();

        String result = null;
        if (stringCollator instanceof CodepointCollator) {
            // fast path for this common case
            int j = s0.indexOf(s1);
            if (j<0) {
                result = "";
            } else {
                result = s0.substring(0, j);
            }

        } else {
            doesNotSupportSubstringMatching(context);
        }
        StringValue s = StringValue.makeStringValue(result);
        if (arg0.isKnownToContainNoSurrogates()) {
            s.setContainsNoSurrogates();
        }
        return s;
    }
View Full Code Here

Examples of client.net.sf.saxon.ce.value.StringValue

            return stringCollator;
        } else {
            int numargs = argument.length;
            if (numargs > arg) {
                AtomicValue av = (AtomicValue) argument[arg].evaluateItem(context);
                StringValue collationValue = (StringValue) av;
                String collationName = collationValue.getStringValue();
                URI collationURI;
                try {
                    collationURI = new URI(collationName, true);
                    if (!collationURI.isAbsolute()) {
                        if (expressionBaseURI == null) {
View Full Code Here

Examples of client.net.sf.saxon.ce.value.StringValue

        dynamicError("The collation requested for " + getDisplayName() +
                        " does not support substring matching", "FOCH0004", context);
    }

    protected final boolean evalContains(XPathContext context) throws XPathException {
        StringValue arg1 = (StringValue)argument[1].evaluateItem(context);
        if (arg1==null || arg1.isZeroLength()) {
            return true;
        }

        StringValue arg0 = (StringValue)argument[0].evaluateItem(context);
        if (arg0==null || arg0.isZeroLength()) {
            return false;
        }

        String s0 = arg0.getStringValue();
        String s1 = arg1.getStringValue();

        if (stringCollator instanceof CodepointCollator) {
            return doComparison(s0, s1);
        } else {
View Full Code Here

Examples of client.net.sf.saxon.ce.value.StringValue

        AtomicValue av1 = (AtomicValue)argument[0].evaluateItem(context);
        long arity = -1;
        if (argument.length == 2) {
            arity = ((NumericValue)argument[1].evaluateItem(context)).intValue();
        }
        StringValue nameValue = (StringValue)av1;
        String lexicalName = nameValue.getStringValue();
        StructuredQName qName;
        try {
            if (lexicalName.indexOf(':') < 0) {
                // we're in XSLT, where the default namespace for functions can't be changed
                String uri = (operation == FUNCTION_AVAILABLE
View Full Code Here

Examples of client.net.sf.saxon.ce.value.StringValue

    /**
    * Evaluate the function
    */

    public Item evaluateItem(XPathContext context) throws XPathException {
        StringValue sv = (StringValue)argument[0].evaluateItem(context);
        if (sv==null) {
            return StringValue.EMPTY_STRING;
        }
        String str = sv.getStringValue();
        double start = ((DoubleValue)argument[1].evaluateItem(context)).round().getDoubleValue();
        double length;
        if (argument.length==2) {
            length = (double)str.length();
        } else {
            length = ((DoubleValue)argument[2].evaluateItem(context)).round().getDoubleValue();
            if (length < 0) {
              length = 0;
            }
        }
        FastStringBuffer sb = new FastStringBuffer((int)length);
        int i=0;
        int pos=0;
        while(i<start-1 && pos<str.length()) {
            int c = (int)str.charAt(pos++);
            if (c<55296 || c>56319) i++;    // don't count high surrogates, i.e. D800 to DBFF
        }
        int j=0;
        while (j<length && pos<str.length()) {
            char c = str.charAt(pos++);
            sb.append(c);
            if ((int)c<55296 || (int)c>56319) j++;    // don't count high surrogates, i.e. D800 to DBFF
        }
        StringValue result = new StringValue(sb);
        if (sv.isKnownToContainNoSurrogates()) {
            result.setContainsNoSurrogates();
        }
        return result;
    }
View Full Code Here

Examples of client.net.sf.saxon.ce.value.StringValue

        if (value==null) {
            return null;
        }
        String format = argument[1].evaluateItem(context).getStringValue();

        StringValue calendarVal = null;
        StringValue countryVal = null;
        StringValue languageVal = null;
        if (argument.length > 2) {
            languageVal = (StringValue)argument[2].evaluateItem(context);
            calendarVal = (StringValue)argument[3].evaluateItem(context);
            countryVal = (StringValue)argument[4].evaluateItem(context);
        }

        String language = (languageVal == null ? null : languageVal.getStringValue());
        String country = (countryVal == null ? null : countryVal.getStringValue());
        CharSequence result = formatDate(value, format, language, country, context);
        if (calendarVal != null) {
            String cal = calendarVal.getStringValue();
            if (!cal.equals("AD") && !cal.equals("ISO")) {
                result = "[Calendar: AD]" + result.toString();
            }
        }
        return new StringValue(result);
    }
View Full Code Here

Examples of client.net.sf.saxon.ce.value.StringValue

    /**
     * Evaluate the function
     */

    public Item evaluateItem(XPathContext context) throws XPathException {
        StringValue arg1 = (StringValue)argument[0].evaluateItem(context);
        StringValue arg2 = (StringValue)argument[1].evaluateItem(context);

        if (arg1 == null) {
            arg1 = StringValue.EMPTY_STRING;
        }
        if (arg2 == null) {
            arg2 = StringValue.EMPTY_STRING;
        }
        if (arg2.isZeroLength()) {
            return arg1;
        }
        if (arg1.isZeroLength()) {
            return StringValue.EMPTY_STRING;
        }

        String s1 = arg1.getStringValue();
        String s2 = arg2.getStringValue();

        String result = null;
        if (stringCollator instanceof CodepointCollator) {
            // fast path for this common case
            int i = s1.indexOf(s2);
            if (i < 0) {
                result = "";
            } else {
                result = s1.substring(i + s2.length());
            }

        } else {
            doesNotSupportSubstringMatching(context);
        }
        StringValue s = StringValue.makeStringValue(result);
        if (arg1.isKnownToContainNoSurrogates()) {
            s.setContainsNoSurrogates();
        }
        return s;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.