jakarta-slide-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject cvs commit: jakarta-slide/proposals/jcrri/src/org/apache/slide/jcr/util Serializer.java
Date Tue, 03 Jun 2003 14:45:24 GMT
stefan      2003/06/03 07:45:22

  Modified:    proposals/jcrri/src/org/apache/slide/jcr/util
                        Serializer.java
  Log:
  jcr ri: misc.
  
  Revision  Changes    Path
  1.4       +14 -6     jakarta-slide/proposals/jcrri/src/org/apache/slide/jcr/util/Serializer.java
  
  Index: Serializer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/proposals/jcrri/src/org/apache/slide/jcr/util/Serializer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Serializer.java	30 May 2003 13:22:37 -0000	1.3
  +++ Serializer.java	3 Jun 2003 14:45:22 -0000	1.4
  @@ -249,12 +249,20 @@
           try {
               indent(level);
               writer.write("<" + PROPERTY_ELEMENT + " " + NAME_ATTRIBUTE + "=\"" + property.getName()
+ "\"");
  -            if (property.getType() == PropertyType.BINARY) {
  -                if (binaryAsLink) {
  -                    writer.write(" " + TYPE_ATTRIBUTE + "=\"" + PropertyType.TYPENAME_SOFTLINK
+ "\"");
  -                } else {
  -                    writer.write(" " + TYPE_ATTRIBUTE + "=\"" + PropertyType.TYPENAME_BINARY
+ "\"");
  -                }
  +            int type = property.getType();
  +            String typeName;
  +            try {
  +                typeName = PropertyType.nameFromValue(type);
  +            } catch (IllegalArgumentException iae) {
  +                // should never be getting here
  +                throw new RepositoryException("unexpected property-type ordinal: " + type,
iae);
  +            }
  +            if (type == PropertyType.BINARY && binaryAsLink) {
  +                typeName = PropertyType.TYPENAME_SOFTLINK;
  +            }
  +            writer.write(" " + TYPE_ATTRIBUTE + "=\"" + typeName + "\"");
  +            if (type == PropertyType.BINARY && !binaryAsLink) {
  +                writer.write(" " + ENCODING_ATTRIBUTE + "=\"Base64\"");
               }
               if (property.hasValue()) {
                   writer.write(">");
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org


Mime
View raw message