|  1 |     | 
     | 
  |  2 |     | 
     | 
  |  3 |     | 
     | 
  |  4 |     | 
     | 
  |  5 |     | 
     | 
  |  6 |     | 
     | 
  |  7 |     | 
     | 
  |  8 |     | 
     | 
  |  9 |     | 
     | 
  |  10 |     | 
     | 
  |  11 |     | 
     | 
  |  12 |     | 
     | 
  |  13 |     | 
     | 
  |  14 |     | 
     | 
  |  15 |     | 
     | 
  |  16 |     | 
   package org.kuali.rice.kew.api.document;  | 
  |  17 |     | 
     | 
  |  18 |     | 
   import java.io.Serializable;  | 
  |  19 |     | 
   import java.util.ArrayList;  | 
  |  20 |     | 
   import java.util.Collection;  | 
  |  21 |     | 
   import java.util.Collections;  | 
  |  22 |     | 
   import java.util.List;  | 
  |  23 |     | 
     | 
  |  24 |     | 
   import javax.xml.bind.annotation.XmlAccessType;  | 
  |  25 |     | 
   import javax.xml.bind.annotation.XmlAccessorType;  | 
  |  26 |     | 
   import javax.xml.bind.annotation.XmlAnyElement;  | 
  |  27 |     | 
   import javax.xml.bind.annotation.XmlElement;  | 
  |  28 |     | 
   import javax.xml.bind.annotation.XmlElementWrapper;  | 
  |  29 |     | 
   import javax.xml.bind.annotation.XmlRootElement;  | 
  |  30 |     | 
   import javax.xml.bind.annotation.XmlType;  | 
  |  31 |     | 
     | 
  |  32 |     | 
   import org.apache.commons.lang.builder.EqualsBuilder;  | 
  |  33 |     | 
   import org.apache.commons.lang.builder.HashCodeBuilder;  | 
  |  34 |     | 
   import org.apache.commons.lang.builder.ToStringBuilder;  | 
  |  35 |     | 
   import org.kuali.rice.core.api.CoreConstants;  | 
  |  36 |     | 
   import org.kuali.rice.core.api.mo.ModelBuilder;  | 
  |  37 |     | 
   import org.w3c.dom.Element;  | 
  |  38 |     | 
     | 
  |  39 |     | 
     | 
  |  40 |     | 
     | 
  |  41 |     | 
     | 
  |  42 |     | 
     | 
  |  43 |     | 
     | 
  |  44 |     | 
     | 
  |  45 |     | 
     | 
  |  46 |     | 
     | 
  |  47 |     | 
     | 
  |  48 |     | 
     | 
  |  49 |     | 
     | 
  |  50 |     | 
     | 
  |  51 |     | 
   @XmlRootElement(name = DocumentContentUpdate.Constants.ROOT_ELEMENT_NAME)  | 
  |  52 |     | 
   @XmlAccessorType(XmlAccessType.NONE)  | 
  |  53 |     | 
   @XmlType(name = DocumentContentUpdate.Constants.TYPE_NAME, propOrder = { | 
  |  54 |     | 
       DocumentContentUpdate.Elements.APPLICATION_CONTENT,  | 
  |  55 |     | 
       DocumentContentUpdate.Elements.ATTRIBUTE_CONTENT,  | 
  |  56 |     | 
       DocumentContentUpdate.Elements.SEARCHABLE_CONTENT,  | 
  |  57 |     | 
       DocumentContentUpdate.Elements.ATTRIBUTE_DEFINITIONS,  | 
  |  58 |     | 
       DocumentContentUpdate.Elements.SEARCHABLE_DEFINITIONS,  | 
  |  59 |     | 
       CoreConstants.CommonElements.FUTURE_ELEMENTS  | 
  |  60 |     | 
   })  | 
  |  61 |    0 |    public final class DocumentContentUpdate implements Serializable { | 
  |  62 |     | 
     | 
  |  63 |     | 
           private static final long serialVersionUID = -7386661044232391889L;  | 
  |  64 |     | 
     | 
  |  65 |     | 
           @XmlElement(name = Elements.APPLICATION_CONTENT, required = false)  | 
  |  66 |     | 
           private final String applicationContent;  | 
  |  67 |     | 
             | 
  |  68 |     | 
           @XmlElement(name = Elements.ATTRIBUTE_CONTENT, required = false)  | 
  |  69 |     | 
           private final String attributeContent;  | 
  |  70 |     | 
     | 
  |  71 |     | 
           @XmlElement(name = Elements.SEARCHABLE_CONTENT, required = false)  | 
  |  72 |     | 
           private final String searchableContent;  | 
  |  73 |     | 
             | 
  |  74 |     | 
           @XmlElementWrapper(name = Elements.ATTRIBUTE_DEFINITIONS, required = false)  | 
  |  75 |     | 
           @XmlElement(name = Elements.ATTRIBUTE_DEFINITION, required = false)  | 
  |  76 |     | 
       private List<WorkflowAttributeDefinition> attributeDefinitions;  | 
  |  77 |     | 
     | 
  |  78 |     | 
           @XmlElementWrapper(name = Elements.SEARCHABLE_DEFINITIONS, required = false)  | 
  |  79 |     | 
           @XmlElement(name = Elements.SEARCHABLE_DEFINITION, required = false)  | 
  |  80 |     | 
           private List<WorkflowAttributeDefinition> searchableDefinitions;  | 
  |  81 |     | 
         | 
  |  82 |    0 |            @SuppressWarnings("unused") | 
  |  83 |     | 
       @XmlAnyElement  | 
  |  84 |     | 
       private final Collection<Element> _futureElements = null;  | 
  |  85 |     | 
         | 
  |  86 |     | 
             | 
  |  87 |     | 
     | 
  |  88 |     | 
     | 
  |  89 |    0 |            private DocumentContentUpdate() { | 
  |  90 |    0 |                this.applicationContent = null;  | 
  |  91 |    0 |                this.attributeContent = null;  | 
  |  92 |    0 |                this.searchableContent = null;  | 
  |  93 |    0 |                this.attributeDefinitions = null;  | 
  |  94 |    0 |                this.searchableDefinitions = null;  | 
  |  95 |    0 |            }  | 
  |  96 |     | 
             | 
  |  97 |    0 |        private DocumentContentUpdate(Builder builder) { | 
  |  98 |    0 |                this.applicationContent = builder.getApplicationContent();  | 
  |  99 |    0 |                this.attributeContent = builder.getAttributeContent();  | 
  |  100 |    0 |                this.searchableContent = builder.getSearchableContent();  | 
  |  101 |    0 |                if (builder.getAttributeDefinitions() != null) { | 
  |  102 |    0 |                        this.attributeDefinitions = new ArrayList<WorkflowAttributeDefinition>(builder.getAttributeDefinitions());  | 
  |  103 |     | 
               } else { | 
  |  104 |    0 |                        this.attributeDefinitions = new ArrayList<WorkflowAttributeDefinition>();  | 
  |  105 |     | 
               }  | 
  |  106 |    0 |                if (builder.getSearchableDefinitions() != null) { | 
  |  107 |    0 |                        this.searchableDefinitions = new ArrayList<WorkflowAttributeDefinition>(builder.getSearchableDefinitions());  | 
  |  108 |     | 
               } else { | 
  |  109 |    0 |                        this.searchableDefinitions = new ArrayList<WorkflowAttributeDefinition>();  | 
  |  110 |     | 
               }  | 
  |  111 |    0 |        }  | 
  |  112 |     | 
             | 
  |  113 |     | 
           public String getApplicationContent() { | 
  |  114 |    0 |                    return applicationContent;  | 
  |  115 |     | 
           }  | 
  |  116 |     | 
             | 
  |  117 |     | 
           public String getAttributeContent() { | 
  |  118 |    0 |                    return attributeContent;  | 
  |  119 |     | 
           }  | 
  |  120 |     | 
             | 
  |  121 |     | 
           public String getSearchableContent() { | 
  |  122 |    0 |                    return searchableContent;  | 
  |  123 |     | 
           }  | 
  |  124 |     | 
     | 
  |  125 |     | 
           public List<WorkflowAttributeDefinition> getAttributeDefinitions() { | 
  |  126 |    0 |                    return Collections.unmodifiableList(attributeDefinitions);  | 
  |  127 |     | 
           }  | 
  |  128 |     | 
     | 
  |  129 |     | 
           public List<WorkflowAttributeDefinition> getSearchableDefinitions() { | 
  |  130 |    0 |                    return Collections.unmodifiableList(searchableDefinitions);  | 
  |  131 |     | 
           }  | 
  |  132 |     | 
             | 
  |  133 |     | 
           @Override  | 
  |  134 |     | 
       public int hashCode() { | 
  |  135 |    0 |            return HashCodeBuilder.reflectionHashCode(this, Constants.HASH_CODE_EQUALS_EXCLUDE);  | 
  |  136 |     | 
       }  | 
  |  137 |     | 
     | 
  |  138 |     | 
       @Override  | 
  |  139 |     | 
       public boolean equals(Object object) { | 
  |  140 |    0 |            return EqualsBuilder.reflectionEquals(object, this, Constants.HASH_CODE_EQUALS_EXCLUDE);  | 
  |  141 |     | 
       }  | 
  |  142 |     | 
     | 
  |  143 |     | 
       @Override  | 
  |  144 |     | 
       public String toString() { | 
  |  145 |    0 |            return ToStringBuilder.reflectionToString(this);  | 
  |  146 |     | 
       }  | 
  |  147 |     | 
             | 
  |  148 |     | 
             | 
  |  149 |     | 
     | 
  |  150 |     | 
     | 
  |  151 |    0 |            public final static class Builder implements Serializable, ModelBuilder { | 
  |  152 |     | 
     | 
  |  153 |     | 
                   private static final long serialVersionUID = -1680695196516508680L;  | 
  |  154 |     | 
     | 
  |  155 |     | 
                   private String attributeContent;  | 
  |  156 |     | 
                   private String applicationContent;  | 
  |  157 |     | 
                   private String searchableContent;  | 
  |  158 |     | 
                   private List<WorkflowAttributeDefinition> attributeDefinitions;  | 
  |  159 |     | 
                   private List<WorkflowAttributeDefinition> searchableDefinitions;  | 
  |  160 |     | 
     | 
  |  161 |    0 |                    private Builder() { | 
  |  162 |    0 |                            this.attributeContent = "";  | 
  |  163 |    0 |                            this.applicationContent = "";  | 
  |  164 |    0 |                            this.searchableContent = "";  | 
  |  165 |    0 |                            this.attributeDefinitions = new ArrayList<WorkflowAttributeDefinition>();  | 
  |  166 |    0 |                            this.searchableDefinitions = new ArrayList<WorkflowAttributeDefinition>();  | 
  |  167 |    0 |                    }  | 
  |  168 |     | 
     | 
  |  169 |     | 
                   public static Builder create() { | 
  |  170 |    0 |                            return new Builder();  | 
  |  171 |     | 
                   }  | 
  |  172 |     | 
     | 
  |  173 |     | 
                   public static Builder create(DocumentContent documentContent) { | 
  |  174 |    0 |                            if (documentContent == null) { | 
  |  175 |    0 |                                    throw new IllegalArgumentException("documentContent was null"); | 
  |  176 |     | 
                           }  | 
  |  177 |    0 |                            Builder builder = create();  | 
  |  178 |    0 |                            builder.setAttributeContent(documentContent.getAttributeContent());  | 
  |  179 |    0 |                            builder.setApplicationContent(documentContent.getApplicationContent());  | 
  |  180 |    0 |                            builder.setSearchableContent(documentContent.getSearchableContent());  | 
  |  181 |    0 |                            return builder;  | 
  |  182 |     | 
                   }  | 
  |  183 |     | 
                     | 
  |  184 |     | 
                   public static Builder create(DocumentContentUpdate documentContentUpdate) { | 
  |  185 |    0 |                            if (documentContentUpdate == null) { | 
  |  186 |    0 |                                    throw new IllegalArgumentException("documentContentUpdate was null"); | 
  |  187 |     | 
                           }  | 
  |  188 |    0 |                            Builder builder = create();  | 
  |  189 |    0 |                            builder.setAttributeContent(documentContentUpdate.getAttributeContent());  | 
  |  190 |    0 |                            builder.setApplicationContent(documentContentUpdate.getApplicationContent());  | 
  |  191 |    0 |                            builder.setSearchableContent(documentContentUpdate.getSearchableContent());  | 
  |  192 |    0 |                            builder.setAttributeDefinitions(documentContentUpdate.getAttributeDefinitions());  | 
  |  193 |    0 |                            builder.setSearchableDefinitions(documentContentUpdate.getSearchableDefinitions());  | 
  |  194 |    0 |                            return builder;  | 
  |  195 |     | 
                   }  | 
  |  196 |     | 
     | 
  |  197 |     | 
                   public DocumentContentUpdate build() { | 
  |  198 |    0 |                            return new DocumentContentUpdate(this);  | 
  |  199 |     | 
                   }  | 
  |  200 |     | 
     | 
  |  201 |     | 
                   public String getAttributeContent() { | 
  |  202 |    0 |                            return attributeContent;  | 
  |  203 |     | 
                   }  | 
  |  204 |     | 
     | 
  |  205 |     | 
                   public void setAttributeContent(String attributeContent) { | 
  |  206 |    0 |                            this.attributeContent = attributeContent;  | 
  |  207 |    0 |                    }  | 
  |  208 |     | 
     | 
  |  209 |     | 
                   public String getApplicationContent() { | 
  |  210 |    0 |                            return applicationContent;  | 
  |  211 |     | 
                   }  | 
  |  212 |     | 
     | 
  |  213 |     | 
                   public void setApplicationContent(String applicationContent) { | 
  |  214 |    0 |                            this.applicationContent = applicationContent;  | 
  |  215 |    0 |                    }  | 
  |  216 |     | 
     | 
  |  217 |     | 
                   public String getSearchableContent() { | 
  |  218 |    0 |                            return searchableContent;  | 
  |  219 |     | 
                   }  | 
  |  220 |     | 
     | 
  |  221 |     | 
                   public void setSearchableContent(String searchableContent) { | 
  |  222 |    0 |                            this.searchableContent = searchableContent;  | 
  |  223 |    0 |                    }  | 
  |  224 |     | 
     | 
  |  225 |     | 
                   public List<WorkflowAttributeDefinition> getAttributeDefinitions() { | 
  |  226 |    0 |                            return attributeDefinitions;  | 
  |  227 |     | 
                   }  | 
  |  228 |     | 
     | 
  |  229 |     | 
                   public void setAttributeDefinitions(List<WorkflowAttributeDefinition> attributeDefinitions) { | 
  |  230 |    0 |                            this.attributeDefinitions = attributeDefinitions;  | 
  |  231 |    0 |                    }  | 
  |  232 |     | 
     | 
  |  233 |     | 
                   public List<WorkflowAttributeDefinition> getSearchableDefinitions() { | 
  |  234 |    0 |                            return searchableDefinitions;  | 
  |  235 |     | 
                   }  | 
  |  236 |     | 
     | 
  |  237 |     | 
                   public void setSearchableDefinitions(List<WorkflowAttributeDefinition> searchableDefinitions) { | 
  |  238 |    0 |                            this.searchableDefinitions = searchableDefinitions;  | 
  |  239 |    0 |                    }  | 
  |  240 |     | 
     | 
  |  241 |     | 
           }  | 
  |  242 |     | 
             | 
  |  243 |     | 
         | 
  |  244 |     | 
     | 
  |  245 |     | 
     | 
  |  246 |    0 |        static class Constants { | 
  |  247 |     | 
           final static String ROOT_ELEMENT_NAME = "documentContentUpdate";  | 
  |  248 |     | 
           final static String TYPE_NAME = "DocumentContentUpdateType";  | 
  |  249 |    0 |            final static String[] HASH_CODE_EQUALS_EXCLUDE = new String[] { CoreConstants.CommonElements.FUTURE_ELEMENTS }; | 
  |  250 |     | 
       }  | 
  |  251 |     | 
     | 
  |  252 |     | 
         | 
  |  253 |     | 
     | 
  |  254 |     | 
     | 
  |  255 |    0 |        static class Elements { | 
  |  256 |     | 
           final static String APPLICATION_CONTENT = "applicationContent";  | 
  |  257 |     | 
           final static String ATTRIBUTE_CONTENT = "attributeContent";  | 
  |  258 |     | 
           final static String SEARCHABLE_CONTENT = "searchableContent";  | 
  |  259 |     | 
           final static String ATTRIBUTE_DEFINITION = "attributeDefinition";  | 
  |  260 |     | 
           final static String ATTRIBUTE_DEFINITIONS = "attributeDefinitions";  | 
  |  261 |     | 
           final static String SEARCHABLE_DEFINITION = "searchableDefinition";  | 
  |  262 |     | 
           final static String SEARCHABLE_DEFINITIONS = "searchableDefinitions";  | 
  |  263 |     | 
       }  | 
  |  264 |     | 
     | 
  |  265 |     | 
   }  |