Package org.jrdf.util.boundary

Examples of org.jrdf.util.boundary.RegexMatcher.group()


    public String[] parse(String s) {
        checkNotEmptyString("s", s);
        RegexMatcher matcher = regexFactory.createMatcher(pattern, s);
        String[] values = new String[LITERAL_VALUES_LENGTH];
        if (matcher.matches()) {
            String ntriplesLiteral = matcher.group(LITERAL_INDEX);
            values[0] = nTripleUtil.unescapeLiteral(ntriplesLiteral);
            values[1] = matcher.group(LANGUAGE_INDEX);
            values[2] = getDatatypeString(matcher);
        }
        return values;
View Full Code Here


        RegexMatcher matcher = regexFactory.createMatcher(pattern, s);
        String[] values = new String[LITERAL_VALUES_LENGTH];
        if (matcher.matches()) {
            String ntriplesLiteral = matcher.group(LITERAL_INDEX);
            values[0] = nTripleUtil.unescapeLiteral(ntriplesLiteral);
            values[1] = matcher.group(LANGUAGE_INDEX);
            values[2] = getDatatypeString(matcher);
        }
        return values;
    }
View Full Code Here

    public boolean handlePrefix(final CharSequence line) {
        final RegexMatcher prefixMatcher = regexMatcherFactory.createMatcher(PREFIX_REGEX, line);
        final boolean matched = prefixMatcher.matches();
        if (matched) {
            final String prefix = prefixMatcher.group(PREFIX_GROUP);
            final String uri = prefixMatcher.group(URI_GROUP);
            listener.handleNamespace(prefix, uri);
        }
        return matched;
    }
View Full Code Here

    public boolean handlePrefix(final CharSequence line) {
        final RegexMatcher prefixMatcher = regexMatcherFactory.createMatcher(PREFIX_REGEX, line);
        final boolean matched = prefixMatcher.matches();
        if (matched) {
            final String prefix = prefixMatcher.group(PREFIX_GROUP);
            final String uri = prefixMatcher.group(URI_GROUP);
            listener.handleNamespace(prefix, uri);
        }
        return matched;
    }
}
View Full Code Here

    public String[] parse(final String s) {
        checkNotEmptyString("s", s);
        final RegexMatcher matcher = regexFactory.createMatcher(pattern, s);
        final String[] values = new String[LITERAL_VALUES_LENGTH];
        if (matcher.matches()) {
            final String ntriplesLiteral = matcher.group(LITERAL_INDEX);
            values[0] = nTripleUtil.unescapeLiteral(ntriplesLiteral);
            values[1] = matcher.group(LANGUAGE_INDEX);
            values[2] = matcher.group(DATATYPE_INDEX);
        }
        return values;
View Full Code Here

        final RegexMatcher matcher = regexFactory.createMatcher(pattern, s);
        final String[] values = new String[LITERAL_VALUES_LENGTH];
        if (matcher.matches()) {
            final String ntriplesLiteral = matcher.group(LITERAL_INDEX);
            values[0] = nTripleUtil.unescapeLiteral(ntriplesLiteral);
            values[1] = matcher.group(LANGUAGE_INDEX);
            values[2] = matcher.group(DATATYPE_INDEX);
        }
        return values;
    }
}
View Full Code Here

        final String[] values = new String[LITERAL_VALUES_LENGTH];
        if (matcher.matches()) {
            final String ntriplesLiteral = matcher.group(LITERAL_INDEX);
            values[0] = nTripleUtil.unescapeLiteral(ntriplesLiteral);
            values[1] = matcher.group(LANGUAGE_INDEX);
            values[2] = matcher.group(DATATYPE_INDEX);
        }
        return values;
    }
}
View Full Code Here

    }

    public URIReference parseURIReferenceWithNamespace(String s) throws ParseException {
        final RegexMatcher regexMatcher = matcherFactory.createMatcher(REGEX, s);
        if (regexMatcher.matches()) {
            final String fullURI = listener.getFullURI(regexMatcher.group(PREFIX_GROUP));
            final String local = regexMatcher.group(LOCAL_GROUP);
            return parseURIReference(fullURI + local);
        } else {
            return null;
        }
View Full Code Here

    public URIReference parseURIReferenceWithNamespace(String s) throws ParseException {
        final RegexMatcher regexMatcher = matcherFactory.createMatcher(REGEX, s);
        if (regexMatcher.matches()) {
            final String fullURI = listener.getFullURI(regexMatcher.group(PREFIX_GROUP));
            final String local = regexMatcher.group(LOCAL_GROUP);
            return parseURIReference(fullURI + local);
        } else {
            return null;
        }
    }
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.