Package railo.commons.lang

Examples of railo.commons.lang.ParserString


   * @param var variable string to get value to
   * @param defaultValue value returnded if variable was not found
   * @return the value or default value if not found
   */
  public static Object getVariableEL(PageContext pc,String var, Object defaultValue) {
        StringList list = parse(pc,new ParserString(var),false);
        if(list==null) return defaultValue;
       
    int scope=scopeString2Int(list.next());
    Object coll =null;
    if(scope==Scope.SCOPE_UNDEFINED) {
View Full Code Here


    }
    return coll;
    }
 
  public static Object getVariableELAsCollection(PageContext pc,String var, Object defaultValue) {
        StringList list = parse(pc,new ParserString(var),false);
        if(list==null) return defaultValue;
       
    int scope=scopeString2Int(list.next());
    Object coll =null;
    if(scope==Scope.SCOPE_UNDEFINED) {
View Full Code Here

   * @param var variable name to get
   * @return variable as Reference
   * @throws PageException
   */
  public static VariableReference getVariableReference(PageContext pc,String var) throws PageException {
      StringList list = parse(pc,new ParserString(var),false);
        if(list==null) throw new InterpreterException("invalid variable declaration ["+var+"]");
       
    if(list.size()==1) {
      return new VariableReference(pc.undefinedScope(),list.next());
    }
View Full Code Here

   * @param value value to set to variable
   * @return value setted
   * @throws PageException
   */
  public static Object setVariable(PageContext pc,String var, Object value) throws PageException {     
      StringList list = parse(pc,new ParserString(var),false);
        if(list==null) throw new InterpreterException("invalid variable name declaration ["+var+"]");

    if(list.size()==1) {
      return pc.undefinedScope().set(list.next(),value);
    }
View Full Code Here

   * @return has removed or not
   * @throws PageException
   */
  public static Object removeVariable(PageContext pc,String var) throws PageException
      //print.ln("var:"+var);
      StringList list = parse(pc,new ParserString(var),false);
        if(list==null) throw new InterpreterException("invalid variable declaration ["+var+"]");
       
    if(list.size()==1) {
      return pc.undefinedScope().remove(KeyImpl.init(list.next()));
    }
View Full Code Here

   * @param pc PageContext to check
   * @param var variable String
   * @return exists or not
   */
  public static boolean isDefined(PageContext pc,String var) {
    StringList list = parse(pc,new ParserString(var),false);
    if(list==null) return false;
        try {
      int scope=scopeString2Int(list.next());
      Object coll =NULL;
      if(scope==Scope.SCOPE_UNDEFINED) {
View Full Code Here

        list.reset();
        return list;
    }
   
    public static StringList parse(String var, boolean doLowerCase) {
      ParserString ps = new ParserString(var);
        String id=readIdentifier(ps,doLowerCase);
        if(id==null)return null;
        StringList list=new StringList(id);
       
        while(true) {
            if(ps.forwardIfCurrent('.')) {
              id=readIdentifier(ps,doLowerCase);
              if(id==null)return null;
              list.add(id);
            }
            else break;
        }
        if(ps.isValidIndex()) return null;
        list.reset();
        return list;
    }
View Full Code Here

            bool.add(new TermQuery(new Term(FIELD, "dshnuiaslfspfhsadhfisd")), OccurUtil.toOccur(false, true));
            results.put(criteria,bool);
            return bool;
        }
       
        ParserString ps=new ParserString(criteria);
        qry= orOp(ps);
        results.put(criteria,qry);
        return qry;
    }
View Full Code Here

        if(criteria.length()==0) {
          return null;
        }
       
        //StringBuffer str=new StringBuffer();
        ParserString ps=new ParserString(criteria);
        Op op=null;
        while(!ps.isAfterLast()) {
          if(op==null)op=orOp(ps);
          else op=new Concator(op,orOp(ps));
        }
        return op;
    }
View Full Code Here

TOP

Related Classes of railo.commons.lang.ParserString

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.