1 29 30 package com.caucho.el; 31 32 import com.caucho.vfs.WriteStream; 33 34 import javax.el.ELContext; 35 import javax.el.ELException; 36 import java.io.IOException ; 37 38 41 public class NullLiteral extends Expr { 42 45 public NullLiteral() 46 { 47 } 48 49 52 @Override 53 public boolean isConstant() 54 { 55 return true; 56 } 57 58 65 @Override 66 public Object getValue(ELContext env) 67 throws ELException 68 { 69 return null; 70 } 71 72 75 @Override 76 public boolean print(WriteStream out, ELContext env, boolean isEscaped) 77 throws IOException , ELException 78 { 79 return false; 80 } 81 82 85 @Override 86 public void printCreate(WriteStream os) 87 throws IOException 88 { 89 os.print("new com.caucho.el.NullLiteral()"); 90 } 91 92 95 public boolean equals(Object o) 96 { 97 return (o instanceof NullLiteral); 98 } 99 100 103 public String toString() 104 { 105 return "null"; 106 } 107 } 108 109 | Popular Tags |