Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*    */ package com.sun.xml.bind.marshaller;
 /*    */ 
 /*    */ import java.io.IOException;
 /*    */ import java.io.Writer;
 /*    */ 
 /*    */ public class DumbEscapeHandler
 /*    */   implements CharacterEscapeHandler
 /*    */ {
 /* 55 */   public static final CharacterEscapeHandler theInstance = new DumbEscapeHandler();
/*    */ 
/*    */   public void escape(char[] chint startint lengthboolean isAttValWriter outthrows IOException {
/* 58 */     int limit = start + length;
/* 59 */     for (int i = starti < limiti++)
/* 60 */       switch (ch[i]) {
/*    */       case '&':
/* 62 */         out.write("&amp;");
/* 63 */         break;
/*    */       case '<':
/* 65 */         out.write("&lt;");
/* 66 */         break;
/*    */       case '>':
/* 68 */         out.write("&gt;");
/* 69 */         break;
/*    */       case '"':
/* 71 */         if (isAttVal)
/* 72 */           out.write("&quot;");
/*    */         else {
/* 74 */           out.write(34);
/*    */         }
/* 76 */         break;
/*    */       default:
/* 78 */         if (ch[i] > '') {
/* 79 */           out.write("&#");
/* 80 */           out.write(Integer.toString(ch[i]));
/* 81 */           out.write(59);
/*    */         } else {
/* 83 */           out.write(ch[i]);
/*    */         }
/*    */       }
/*    */   }
/*    */ }
/* Location:           /home/mnovotny/projects/EMBEDDED_JBOSS_BETA3_COMMUNITY/embedded/output/lib/embedded-jboss/lib/thirdparty-all.jar
 * Qualified Name:     com.sun.xml.bind.marshaller.DumbEscapeHandler
 * JD-Core Version:    0.6.0
 */
New to GrepCode? Check out our FAQ X