1 2 25 26 package org.aspectj.asm; 27 28 import java.io.*; 29 30 33 public class StructureMessage implements Serializable { 34 35 private Kind kind; 36 private String message; 37 38 public StructureMessage(String message, Kind kind) { 39 this.message = message; 40 this.kind = kind; 41 } 42 43 public String getMessage() { 44 return message; 45 } 46 47 public Kind getKind() { 48 return kind; 49 } 50 51 54 public static class Kind implements Serializable { 55 public static final Kind ERROR = new Kind("error"); 56 public static final Kind WARNING = new Kind("warning"); 57 public static final Kind INFO = new Kind("info"); 58 public static final Kind[] ALL = { ERROR, WARNING, INFO }; 59 private final String name; 60 61 private Kind(String name) { 62 this.name = name; 63 } 64 65 public String toString() { 66 return name; 67 } 68 69 private static int nextOrdinal = 0; 71 private final int ordinal = nextOrdinal++; 72 private Object readResolve() throws ObjectStreamException { 73 return ALL[ordinal]; 74 } 75 } 76 } 77 | Popular Tags |