View Javadoc
1   package org.codehaus.plexus.util.xml;
2   
3   /*
4    * Copyright The Codehaus Foundation.
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
10   *     http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  
19  import java.io.IOException;
20  
21  import org.codehaus.plexus.util.xml.pull.XmlSerializer;
22  
23  /** @author Jason van Zyl */
24  @Deprecated
25  public class Xpp3DomUtils {
26      /**
27       * @deprecated use {@link Xpp3Dom#CHILDREN_COMBINATION_MODE_ATTRIBUTE}
28       */
29      @Deprecated
30      public static final String CHILDREN_COMBINATION_MODE_ATTRIBUTE = Xpp3Dom.CHILDREN_COMBINATION_MODE_ATTRIBUTE;
31  
32      /**
33       * @deprecated use {@link Xpp3Dom#CHILDREN_COMBINATION_MERGE}
34       */
35      @Deprecated
36      public static final String CHILDREN_COMBINATION_MERGE = Xpp3Dom.CHILDREN_COMBINATION_MERGE;
37  
38      /**
39       * @deprecated use {@link Xpp3Dom#CHILDREN_COMBINATION_APPEND}
40       */
41      @Deprecated
42      public static final String CHILDREN_COMBINATION_APPEND = Xpp3Dom.CHILDREN_COMBINATION_APPEND;
43  
44      /**
45       * @deprecated use {@link Xpp3Dom#DEFAULT_CHILDREN_COMBINATION_MODE}
46       */
47      @Deprecated
48      public static final String DEFAULT_CHILDREN_COMBINATION_MODE = Xpp3Dom.DEFAULT_CHILDREN_COMBINATION_MODE;
49  
50      /**
51       * @deprecated use {@link Xpp3Dom#SELF_COMBINATION_MODE_ATTRIBUTE}
52       */
53      @Deprecated
54      public static final String SELF_COMBINATION_MODE_ATTRIBUTE = Xpp3Dom.SELF_COMBINATION_MODE_ATTRIBUTE;
55  
56      /**
57       * @deprecated use {@link Xpp3Dom#SELF_COMBINATION_OVERRIDE}
58       */
59      @Deprecated
60      public static final String SELF_COMBINATION_OVERRIDE = Xpp3Dom.SELF_COMBINATION_OVERRIDE;
61  
62      /**
63       * @deprecated use {@link Xpp3Dom#SELF_COMBINATION_MERGE}
64       */
65      @Deprecated
66      public static final String SELF_COMBINATION_MERGE = Xpp3Dom.SELF_COMBINATION_MERGE;
67  
68      /**
69       * @deprecated use {@link Xpp3Dom#ID_COMBINATION_MODE_ATTRIBUTE}
70       */
71      @Deprecated
72      public static final String ID_COMBINATION_MODE_ATTRIBUTE = Xpp3Dom.ID_COMBINATION_MODE_ATTRIBUTE;
73  
74      /**
75       * @deprecated use {@link Xpp3Dom#KEYS_COMBINATION_MODE_ATTRIBUTE}
76       */
77      @Deprecated
78      public static final String KEYS_COMBINATION_MODE_ATTRIBUTE = Xpp3Dom.KEYS_COMBINATION_MODE_ATTRIBUTE;
79  
80      /**
81       * @deprecated use {@link Xpp3Dom#DEFAULT_SELF_COMBINATION_MODE}
82       */
83      @Deprecated
84      public static final String DEFAULT_SELF_COMBINATION_MODE = Xpp3Dom.DEFAULT_SELF_COMBINATION_MODE;
85  
86      /**
87       * @deprecated use {@link Xpp3Dom#writeToSerializer(String, XmlSerializer)}
88       */
89      @Deprecated
90      public void writeToSerializer(String namespace, XmlSerializer serializer, Xpp3Dom dom) throws IOException {
91          dom.writeToSerializer(namespace, serializer);
92      }
93  
94      /**
95       * Merge two DOMs, with one having dominance in the case of collision.
96       *
97       * @see #CHILDREN_COMBINATION_MODE_ATTRIBUTE
98       * @see #SELF_COMBINATION_MODE_ATTRIBUTE
99       * @param dominant The dominant DOM into which the recessive value/attributes/children will be merged
100      * @param recessive The recessive DOM, which will be merged into the dominant DOM
101      * @param childMergeOverride Overrides attribute flags to force merging or appending of child elements into the
102      *            dominant DOM
103      * @return merged DOM
104      * @deprecated use {@link Xpp3Dom#mergeXpp3Dom(Xpp3Dom, Xpp3Dom, Boolean)}
105      */
106     @Deprecated
107     public static Xpp3Dom mergeXpp3Dom(Xpp3Dom dominant, Xpp3Dom recessive, Boolean childMergeOverride) {
108         return Xpp3Dom.mergeXpp3Dom(dominant, recessive, childMergeOverride);
109     }
110 
111     /**
112      * Merge two DOMs, with one having dominance in the case of collision. Merge mechanisms (vs. override for nodes, or
113      * vs. append for children) is determined by attributes of the dominant root node.
114      *
115      * @see #CHILDREN_COMBINATION_MODE_ATTRIBUTE
116      * @see #SELF_COMBINATION_MODE_ATTRIBUTE
117      * @param dominant The dominant DOM into which the recessive value/attributes/children will be merged
118      * @param recessive The recessive DOM, which will be merged into the dominant DOM
119      * @return merged DOM
120      * @deprecated use {@link Xpp3Dom#mergeXpp3Dom(Xpp3Dom, Xpp3Dom)}
121      */
122     @Deprecated
123     public static Xpp3Dom mergeXpp3Dom(Xpp3Dom dominant, Xpp3Dom recessive) {
124         return Xpp3Dom.mergeXpp3Dom(dominant, recessive);
125     }
126 
127     /**
128      * @deprecated Use org.codehaus.plexus.util.StringUtils#isNotEmpty(String) instead
129      */
130     @Deprecated
131     public static boolean isNotEmpty(String str) {
132         return (str != null && str.length() > 0);
133     }
134 
135     /**
136      * @deprecated Use org.codehaus.plexus.util.StringUtils#isEmpty(String) instead
137      */
138     @Deprecated
139     public static boolean isEmpty(String str) {
140         return (str == null || str.length() == 0);
141     }
142 }