Example #1
0
 /**
  * Sets the {@linkplain #rootTag} property.
  *
  * @param rootTag to be used as XML root tag
  * @throws IllegalArgumentException if tag is null or empty
  * @throws IllegalStateException if write isn't in initial state
  */
 public void setRootTag(String rootTag) {
   if (!XMLUtil.isLegalXMLTag(rootTag)) {
     throw new IllegalArgumentException("rootTag: illegal: " + rootTag);
   }
   if (!this.isInitialState()) {
     throw new IllegalStateException("writer write in progress");
   }
   this.checkNotSharedConfiguration();
   this.rootTag = rootTag;
 }
Example #2
0
 /**
  * Aliases the given field's name with the given <code>alias</code>. The given alias must not be
  * non-null, not-empty and must not contain illegal characters w.r.t. the XML format.
  *
  * @param f to alias
  * @param alias the alias to set
  * @return the previous alias, if any, or null
  * @throws IllegalArgumentException if alias contains invalid XML chars
  * @throws IllegalStateException if shared configuration
  */
 public String alias(Field f, String alias) {
   XMLUtil.validateAlias(alias);
   this.checkNotSharedConfiguration();
   return this.aliasing.put(f, alias);
 }