Coverage Report - org.simpleframework.xml.core.Decorator
 
Classes in this File Line Coverage Branch Coverage Complexity
Decorator
N/A
N/A
1
 
 1  
 /*
 2  
  * Decorator.java July 2008
 3  
  *
 4  
  * Copyright (C) 2008, Niall Gallagher <niallg@users.sf.net>
 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 
 15  
  * implied. See the License for the specific language governing 
 16  
  * permissions and limitations under the License.
 17  
  */
 18  
 
 19  
 package org.simpleframework.xml.core;
 20  
 
 21  
 import org.simpleframework.xml.stream.OutputNode;
 22  
 
 23  
 /**
 24  
  * The <code>Decorator</code> interface is used to describe an object
 25  
  * that is used to add decorations to an output node. A decoration is
 26  
  * a object that adds information to the output node without any
 27  
  * change to the structure of the node. Decorations can include extra
 28  
  * information like comments and namespaces.
 29  
  * 
 30  
  * @author Niall Gallagher
 31  
  * 
 32  
  * @see org.simpleframework.xml.core.Label
 33  
  */
 34  
 interface Decorator {
 35  
    
 36  
    /**
 37  
     * This method is used to decorate the provided node. This node 
 38  
     * can be either an XML element or an attribute. Decorations that
 39  
     * can be applied to the node by invoking this method include
 40  
     * things like comments and namespaces.
 41  
     * 
 42  
     * @param node this is the node that is to be decorated by this
 43  
     */
 44  
    void decorate(OutputNode node);
 45  
    
 46  
    /**
 47  
     * This method is used to decorate the provided node. This node 
 48  
     * can be either an XML element or an attribute. Decorations that
 49  
     * can be applied to the node by invoking this method include
 50  
     * things like comments and namespaces. This can also be given
 51  
     * another <code>Decorator</code> which is applied before this
 52  
     * decorator, any common data can then be overwritten.
 53  
     * 
 54  
     * @param node this is the node that is to be decorated by this
 55  
     * @param secondary this is a secondary decorator to be applied
 56  
     */
 57  
    void decorate(OutputNode node, Decorator secondary);
 58  
 }