pbwest      2002/10/08 23:08:37

  Modified:    src/org/apache/fop/xml Tag: FOP_0-20-0_Alt-Design
                        XMLEvent.java
  Log:
  Added eventTypeName().
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.3   +26 -25    xml-fop/src/org/apache/fop/xml/Attic/XMLEvent.java
  
  Index: XMLEvent.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/xml/Attic/XMLEvent.java,v
  retrieving revision 1.1.2.2
  retrieving revision 1.1.2.3
  diff -u -r1.1.2.2 -r1.1.2.3
  --- XMLEvent.java     16 Sep 2002 04:26:31 -0000      1.1.2.2
  +++ XMLEvent.java     9 Oct 2002 06:08:37 -0000       1.1.2.3
  @@ -34,6 +34,28 @@
       private static final int MIN_XML_EV_TYPE = NOEVENT;
       private static final int MAX_XML_EV_TYPE = CHARACTERS;
   
  +    public static final boolean DISCARD_W_SPACE = true;
  +    public static final boolean RETAIN_W_SPACE = false;
  +
  +    public static String eventTypeName(int type) {
  +        switch (type) {
  +        case NOEVENT:
  +            return "NOEVENT";
  +        case STARTDOCUMENT:
  +            return "STARTDOCUMENT";
  +        case ENDDOCUMENT:
  +            return "ENDDOCUMENT";
  +        case STARTELEMENT:
  +            return "STARTELEMENT";
  +        case ENDELEMENT:
  +            return "ENDELEMENT";
  +        case CHARACTERS:
  +            return "CHARACTERS";
  +        default:
  +            return "Unknown type " + type;
  +        }
  +    }
  +
       // These are made public specifically so the the values of individual
       // XMLEvent instances can be changed directly, on the assumption that
       // the basic XML events are unlikely to change.
  @@ -171,28 +193,7 @@
   
       public String toString() {
           String tstr;
  -        switch (type) {
  -        case NOEVENT:
  -            tstr = "NOEVENT";
  -            break;
  -        case STARTDOCUMENT:
  -            tstr = "STARTDOCUMENT";
  -            break;
  -        case ENDDOCUMENT:
  -            tstr = "ENDDOCUMENT";
  -            break;
  -        case STARTELEMENT:
  -            tstr = "STARTELEMENT";
  -            break;
  -        case ENDELEMENT:
  -            tstr = "ENDELEMENT";
  -            break;
  -        case CHARACTERS:
  -            tstr = "CHARACTERS";
  -            break;
  -        default:
  -            tstr = "Unknown type " + type;
  -        }
  +        tstr = eventTypeName(type);
           tstr = tstr + "\nURI "
                   + uriIndex + " " + namespaces.getIndexURI(uriIndex);
           tstr = tstr + "\n" + "Local Name " + localName;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to