Package org.modeshape.jcr.query.model.FullTextSearch

Examples of org.modeshape.jcr.query.model.FullTextSearch.SimpleTerm


                                             String... terms ) {
        List<Term> expectedTerms = new ArrayList<Term>();
        for (String term : terms) {
            if (term.startsWith("-")) {
                term = term.substring(1);
                expectedTerms.add(new NegationTerm(new SimpleTerm(term)));
            } else {
                expectedTerms.add(new SimpleTerm(term));
            }
        }
        assertHasTerms(compoundTerm, expectedTerms.toArray(new Term[expectedTerms.size()]));
    }
View Full Code Here


        if (excluded) {
            assertThat(term, is(instanceOf(NegationTerm.class)));
            NegationTerm negationTerm = (NegationTerm)term;
            Term negated = negationTerm.getNegatedTerm();
            assertThat(negated, is(instanceOf(SimpleTerm.class)));
            SimpleTerm simpleTerm = (SimpleTerm)negated;
            assertThat(simpleTerm.getValue(), is(value));
            assertThat(simpleTerm.isQuotingRequired(), is(quotingRequired));
        } else {
            assertThat(term, is(instanceOf(SimpleTerm.class)));
            SimpleTerm simpleTerm = (SimpleTerm)term;
            assertThat(simpleTerm.getValue(), is(value));
            assertThat(simpleTerm.isQuotingRequired(), is(quotingRequired));
        }
    }
View Full Code Here

    }

    protected Term parseTerm( TokenStream tokens ) {
        boolean negated = tokens.canConsume('-');
        if (!negated) tokens.canConsume('+');
        Term result = new SimpleTerm(removeQuotes(tokens.consume()));
        return negated ? new NegationTerm(result) : result;
    }
View Full Code Here

TOP

Related Classes of org.modeshape.jcr.query.model.FullTextSearch.SimpleTerm

Copyright © 2018 www.massapicom. 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.