1 25 package org.archive.util.anvl; 26 27 34 class Value extends SubElement { 35 36 private StringBuilder sb; 37 private boolean folding = false; 38 39 private Value() { 40 this(null); 41 } 42 43 public Value(final String s) { 44 super(s); 45 } 46 47 protected String baseCheck(String s) { 48 this.sb = new StringBuilder (s.length() * 2); 49 super.baseCheck(s); 50 return sb.toString(); 51 } 52 53 @Override 54 protected void checkCharacter(char c, String srcStr, int index) { 55 checkControlCharacter(c, srcStr, index); 56 if (ANVLRecord.isCR(c)) { 59 this.folding = true; 60 this.sb.append(ANVLRecord.FOLD_PREFIX); 61 } else if (ANVLRecord.isLF(c)) { 62 if (!this.folding) { 63 this.folding = true; 64 this.sb.append(ANVLRecord.FOLD_PREFIX); 65 } else { 66 } 68 } else if (this.folding && Character.isWhitespace(c)) { 69 } else { 71 this.folding = false; 72 this.sb.append(c); 73 } 74 } 75 } | Popular Tags |