All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.atteo.xmlcombiner.CombineSelf Maven / Gradle / Ivy

/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.atteo.xmlcombiner;

/**
 * Controls the behavior when merging two XML nodes.
 */
public enum CombineSelf {
	/**
	 * Merge elements.
	 * 

* Attributes from dominant element override those from recessive element. * Child elements are by default paired using their keys (tag name and selected attributes) and combined * recursively. The exact behavior depends on {@link CombineChildren 'combine.children'} attribute value. *

*

* * Example:
* First: *

	 * {@code
	 *  
	 *     
	 *         parameter
	 *     
	 *  
	 * }
	 * 
* Second: *
	 * {@code
	 *  
	 *     
	 *         parameter
	 *     
	 *  
	 * }
	 * 
* Result: *
	 * {@code
	 *  
	 *     
	 *         parameter
	 *         parameter
	 *     
	 *  
	 * }
	 * 
*

*/ MERGE, /** * Remove entire element with attributes and children. * *

* Example:
* First: *

	 * {@code
	 *  
	 *     
	 *         parameter
	 *     
	 *  
	 * }
	 * 
* Second: *
	 * {@code
	 *  
	 *     
	 *  
	 * }
	 * 
* Result: *
	 * {@code
	 *  
	 *  
	 * }
	 * 
*

*/ REMOVE, /** * Behaves exactly like {@link #MERGE} if paired element exists in any subsequent dominant document. * If paired element is not found in any dominant document behaves the same as {@link #REMOVE} *

* This behavior is specifically designed to allow specifying default values which are used only * when given element exists in any subsequent document. *

*

* Example:
* First: *

	 * {@code
	 *  
	 *     
	 *         parameter
	 *     
	 *     
	 *  
	 * }
	 * 
* Second: *
	 * {@code
	 * 
	 *     
	 *     
	 *  
	 * }
	 * 
* Result: *
	 * {@code
	 * 
	 *     
	 *         parameter
	 *     
	 *  
	 * }
	 * 
*

*/ DEFAULTS, /** * Override element. *

* Completely ignores content from recessive document by overwriting it * with element from dominant document. *

* *

* Example:
* First: *

	 * {@code
	 * 
	 *     
	 *         parameter
	 *     
	 *  
	 * }
	 * 
* Second: *
	 * {@code
	 * 
	 *     
	 *         parameter2
	 *     
	 *  
	 * }
	 * 
* Result: *
	 * {@code
	 * 
	 *     
	 *         parameter2
	 *     
	 *  
	 * }
	 * 
*

*/ OVERRIDE, /** * Override element. *

* Completely ignores content from recessive document by overwriting it * with element from dominant document. *

*

* The difference with {@link #OVERRIDE} is that OVERRIDABLE is specified on the tag in recessive document. *

*

* Example:
* First: *

	 * {@code
	 *  
	 *     
	 *         
	 *     
	 *  
	 * }
	 * 
* Second: *
	 * {@code
	 *  
	 *  
	 * }
	 * 
* Result: *
	 * {@code
	 * 
	 *     
	 *         
	 *     
	 *  
	 * }
	 * 
*

*

* Example2:
* First: *

	 * {@code
	 *  
	 *     
	 *         
	 *     
	 *  
	 * }
	 * 
* Second: *
	 * {@code
	 *  
	 * 		
	 *  
	 * }
	 * 
* Result: *
	 * {@code
	 *  
	 * 		
	 *  
	 * }
	 * 
*

*/ OVERRIDABLE, /** * Override element. *

* Completely ignores content from recessive document by overwriting it * with element from dominant document. *

*

* The difference with {@link #OVERRIDABLE} is that with OVERRIDABLE_BY_TAG recessive element is ignored even when the id is different.

*

* Example:
* First: *

	 * {@code
	 *  
	 *     
	 *         
	 *     
	 *  
	 * }
	 * 
* Second: *
	 * {@code
	 *  
	 * 		
	 *  
	 * }
	 * 
* Result: *
	 * {@code
	 *  
	 * 		
	 *  
	 * }
	 * 
*

*/ OVERRIDABLE_BY_TAG; public static final String ATTRIBUTE_NAME = "combine.self"; }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy