Examples of Token


Examples of org.apache.lucene.queryparser.classic.Token

                return new BadRequestException();
            }
            Throwable rootCause = ((SearchParseException) unwrapped).getRootCause();
            if (rootCause instanceof ParseException) {

                Token currentToken = ((ParseException) rootCause).currentToken;
                SearchResponse sr = new SearchResponse();
                sr.query = query;
                sr.error = new QueryParseError();
                if (currentToken == null) {
                    LOG.warn("No position/token available for ParseException.");
View Full Code Here

Examples of org.apache.myfaces.trinidadinternal.el.Tokenizer.Token

    String varDot = var + ".";
    Tokenizer tokens = new Tokenizer(expression);
    StringBuffer buf = new StringBuffer(expression.length());
    while(tokens.hasNext())
    {
      Token tok = tokens.next();
      String exp = tok.getText();
      if (tok.type == Tokenizer.VAR_TYPE)
      {
        if (var.equals(exp) || exp.startsWith(varDot))
        {
          buf.append(subst);
View Full Code Here

Examples of org.apache.qpid.messaging.util.Token

        {
            throw new ParseError(next(), types);
        }
        else
        {
            Token t = next();
            idx += 1;
            return t;
        }
    }
View Full Code Here

Examples of org.apache.rahas.Token

                        SAMLKeyInfo samlKi = SAMLUtil.getSAMLKeyInfo(assertion,
                                signatureCrypto, tokenCallbackHandler);
                        try {
                            TokenStorage store = rmd.getTokenStorage();
                            if(store.getToken(id) == null) {
                                Token token = new Token(id, (OMElement)assertion.toDOM(), created, expires);
                                token.setSecret(samlKi.getSecret());
                                store.add(token);
                            }
                        } catch (Exception e) {
                            throw new RampartException(
                                    "errorInAddingTokenIntoStore", e);
View Full Code Here

Examples of org.apache.shale.clay.parser.Token

               int e = snippet.getBuffer().indexOf(Parser.END_CHARSET_TOKEN, s);
               AttributeTokenizer tokenizer = new AttributeTokenizer(snippet.getBuffer(), s, e, 1, 0);
               Iterator ti = tokenizer.iterator();
               while (ti.hasNext()) {
                   Map.Entry attribute = (Map.Entry) ti.next();
                   Token key = (Token) attribute.getKey();
                   //check the attribute name, we are only interested
                   //in "charset"
                   if (key != null && key.getRawText() != null
                       && key.getRawText().equalsIgnoreCase("charset")) {
                       Token value = (Token) attribute.getValue();

                       //look for the value of the charset attribute
                       if (value != null && value.getRawText() != null) {
                          // if it is supported, use the value for the encoding
                          if (Charset.isSupported(value.getRawText())) {
                              enc = value.getRawText();
                          } else {
                              log.error(messages.getMessage("template.encoding.notsupported",
                                      new Object[] { value.getRawText() }));
                          }
                       }
                   }
               }
            }
View Full Code Here

Examples of org.apache.shale.component.Token

    public void testMessageDefault() throws Exception {
       
        final String SUMMARY_MESSAGE = messages.getMessage("token.summary.invalid");
        final String DETAIL_MESSAGE = messages.getMessage("token.detail.invalid");;
               
        Token token = (Token) facesContext.getApplication().createComponent("org.apache.shale.Token");
        assertNotNull(token);
       
        UIViewRoot root = facesContext.getViewRoot();
        assertNotNull(root);
       
        // add token to the component tree
        root.getChildren().add(root.getChildCount(), token);
             
        token.setId("messageDefault");
        token.setMessageSummary(null)// no message property override
       
        StringBuffer htmlSnippet = encode(token);      
        // check rendered markup
        String id = getAttribute(htmlSnippet, "id");
        assertEquals("id", token.getClientId(facesContext), id);

        String name = getAttribute(htmlSnippet, "name");
        assertEquals("id", token.getClientId(facesContext), name);

        String type = getAttribute(htmlSnippet, "type");
        assertEquals("id", "hidden", type);

        String value = getAttribute(htmlSnippet, "value");
        assertNotNull("value", value);
       
        // simulate form post on dirty page
        Map map = facesContext.getExternalContext().getRequestParameterMap();
        map.put(id, value);
       
        // simulate apply values
        token.decode(facesContext);
        assertEquals("value", value, token.getSubmittedValue());
        
        // simulate validation and invalidates token
        token.validate(facesContext);
       
        checkNoMessages(token);
       
        // simulate double post
        token.validate(facesContext);
       
        // check for the custom message
        checkMessage(SUMMARY_MESSAGE, DETAIL_MESSAGE, token);
       
     }
View Full Code Here

Examples of org.apache.stanbol.commons.opennlp.TextAnalyzer.AnalysedText.Token

    public void process() throws EngineException {
        int debugedIndex = 0;
        while(state.next()) {
            if(log.isDebugEnabled() && (state.getTokenIndex() > debugedIndex || state.getTokenIndex() ==  0)){
                debugedIndex = state.getTokenIndex();
                Token token = state.getToken();
                log.debug(" {} {} (pos:{}|prop:{})",new Object[]{
                    isProcessableToken(token)? '+':'-',
                    token.getText(),token.getPosTags(),token.getPosProbabilities()
                });
            }
            if(isProcessableToken(state.getToken())){
                List<String> searchStrings = new ArrayList<String>(config.getMaxSearchTokens());
                searchStrings.add(state.getToken().getText());
                //get the list of all tokens that can possible be matched
                int includeTokenIndex = state.getTokenIndex();
                includeTokenIndex++;
                while(searchStrings.size() < config.getMaxSearchTokens() && //more search strings
                        (includeTokenIndex <= (state.getChunk() != null ? //still within
                                state.getChunk().getEnd() : //the chunk
                                    state.getSentence().getTokens().size()-1))){ //or sentence
                    Token included = state.getSentence().getTokens().get(includeTokenIndex);
                    if(log.isDebugEnabled()  && includeTokenIndex > debugedIndex){
                        debugedIndex = includeTokenIndex;
                        log.debug(" {} {} (pos:{}|prop:{})",new Object[]{
                            isProcessableToken(included)? '+':'-',
                            included.getText(),included.getPosTags(),included.getPosProbabilities()
                        });
                    }
                    includeTokenIndex++;
                    if(isProcessableToken(included)){
                        searchStrings.add(included.getText());
                    }
                }
                //search for Entities
                List<Suggestion> suggestions = lookupEntities(searchStrings);
                if(!suggestions.isEmpty()){
View Full Code Here

Examples of org.apache.stanbol.enhancer.nlp.model.Token

        TokenStream tokens = new WordTokenFilter(new AnalyzedTextSentenceTokenizer(at));
        try {
          tokens.reset();
            while(tokens.incrementToken()){
                OffsetAttribute offset = tokens.addAttribute(OffsetAttribute.class);
                Token t = at.addToken(offset.startOffset(), offset.endOffset());
                log.trace("detected {}",t);
            }
        } catch (IOException e) {
            String message = String.format("IOException while reading from "
                +"CharSequenceReader of AnalyzedText for ContentItem %s",ci.getUri());
View Full Code Here

Examples of org.apache.struts2.components.Token

    public String getBeanName() {
        return "token";
    }

    protected Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
        return new Token(stack, req, res);
    }
View Full Code Here

Examples of org.apache.taglibs.standard.lang.jstl.parser.Token

    }
    String expected = expectedBuf.toString ();

    // Generate the String of encountered tokens
    StringBuffer encounteredBuf = new StringBuffer ();
    Token tok = pExc.currentToken.next;
    for (int i = 0; i < maxSize; i++) {
      if (i != 0) encounteredBuf.append (" ");
      if (tok.kind == 0) {
        encounteredBuf.append (pExc.tokenImage [0]);
        break;
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.