Package asia.redact.bracket.properties.line

Examples of asia.redact.bracket.properties.line.Line


 
  public void parse(){
   
    try {
    lock.lock();
      Line line = null;
      String key = null;
      BasicValueModel model = new BasicValueModel();
      boolean hasContinuation=false;
      while((line =scanner.line())!=null){
        if(hasContinuation){
          model.addValue(line.logicalLineContents());
          if(line.hasContinuation()){
            continue;
          }else{
            hasContinuation=false;
          }
        }
        if(line.isEmptyLine())continue;
        if(line.isPrivateComment())continue;
        if(line.isCommentLine()){
          if(key !=null){
            props.getPropertyMap().put(key, model);
            key=null;
            model=new BasicValueModel();
          }
          model.addComment(line.commentContents());
          continue;
        }else if(line.isNaturalLine()){
          if(key !=null){
            props.getPropertyMap().put(key, model);
            key=null;
            model=new BasicValueModel();
          }
          String [] parts = line.naturalLineContents();
          key = parts[0];
          model.setSeparator(parts[1].charAt(0));
          hasContinuation=line.hasContinuation();
          model.addValue(parts[2]);
         
        }
      }
      // last one
View Full Code Here


    list = new ArrayList<PropertiesToken>();
  }
 
  public void lex(){
    try {
      Line line = null;
      while((line = scanner.line())!=null){
        if(line.isPrivateComment())continue;
        list.addAll(line.tokens());
      }
    }finally{
      list.add(PropertiesToken.eof());
    }
  }
View Full Code Here

 
  public void parse(){
   
    try {
    lock.lock();
      Line line = null;
      String key = null;
      ValueModel model = new ValueModel();
      boolean hasContinuation=false;
      while((line =scanner.line())!=null){
        if(hasContinuation){
          model.addValue(line.logicalLineContents());
          if(line.hasContinuation()){
            continue;
          }else{
            hasContinuation=false;
          }
        }
        if(line.isEmptyLine())continue;
        if(line.isPrivateComment())continue;
        if(line.isCommentLine()){
          if(key !=null){
            props.getPropertyMap().put(key, model);
            key=null;
            model=new ValueModel();
          }
          model.addComment(line.commentContents());
          continue;
        }else if(line.isNaturalLine()){
          if(key !=null){
            props.getPropertyMap().put(key, model);
            key=null;
            model=new ValueModel();
          }
          String [] parts = line.naturalLineContents();
          key = parts[0];
          model.setSeparator(parts[1].charAt(0));
          hasContinuation=line.hasContinuation();
          model.addValue(parts[2]);
         
        }
      }
      // last one
View Full Code Here

 
  public void parse(){
   
    try {
    lock.lock();
      Line line = null;
      String key = null;
      BasicValueModel model = new BasicValueModel();
      boolean hasContinuation=false;
      while((line =scanner.line())!=null){
        if(hasContinuation){               // previous line has continuation
          model.addValue(line.logicalLineContents()); // so collect the current line
          if(line.hasContinuation()){         // if current line has continuation
            continue;                // then continue our tight collection loop
          }else{                   
            hasContinuation=false;          // the continuation has ended
           
            // Issue 8 fix
            props.getPropertyMap().put(key, model);
            key=null;
            model=new BasicValueModel();
            continue;
          }
        }
        if(line.isEmptyLine())continue;
        if(line.isPrivateComment())continue;
        if(line.isCommentLine()){
          if(key !=null){
            props.getPropertyMap().put(key, model);
            key=null;
            model=new BasicValueModel();
          }
          model.addComment(line.commentContents());
          continue;
        }else if(line.isNaturalLine()){
          if(key !=null){
            props.getPropertyMap().put(key, model);
            key=null;
            model=new BasicValueModel();
          }
          String [] parts = line.naturalLineContents();
          key = parts[0];
          model.setSeparator(parts[1].charAt(0));
          hasContinuation=line.hasContinuation();
          model.addValue(parts[2]);
         
        }
      }
      // last one
View Full Code Here

TOP

Related Classes of asia.redact.bracket.properties.line.Line

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.