Coverage Report - org.simpleframework.xml.NamespaceList
 
Classes in this File Line Coverage Branch Coverage Complexity
NamespaceList
N/A
N/A
0
 
 1  
 /*
 2  
  * NamespaceList.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;
 20  
 
 21  
 import java.lang.annotation.Retention;
 22  
 import java.lang.annotation.RetentionPolicy;
 23  
 
 24  
 /**
 25  
  * The <code>NamespaceList</code> annotation that is used to declare
 26  
  * namespaces that can be added to an element. This is used when 
 27  
  * there are several namespaces to add to the element without setting
 28  
  * any namespace to the element. This is useful when the scope of a
 29  
  * namespace needs to span several nodes. All prefixes declared in 
 30  
  * the namespaces will be available to the child nodes.
 31  
  * <pre>
 32  
  * 
 33  
  *    &lt;example xmlns:root="http://www.example.com/root"&gt;
 34  
  *       &lt;anonymous&gt;anonymous element&lt;/anonymous&gt;
 35  
  *    &lt;/example&gt;
 36  
  *    
 37  
  * </pre>
 38  
  * The above XML example shows how a prefixed namespace has been added
 39  
  * to the element without qualifying that element. Such declarations
 40  
  * will allow child elements to pick up the parents prefix when this
 41  
  * is required, this avoids having to redeclare the same namespace.
 42  
  * 
 43  
  * @author Niall Gallagher
 44  
  *
 45  
  * @see org.simpleframework.xml.Namespace
 46  
  */
 47  
 @Retention(RetentionPolicy.RUNTIME)
 48  
 public @interface NamespaceList {
 49  
 
 50  
    /**
 51  
     * This is used to acquire the namespaces that are declared on
 52  
     * the class. Any number of namespaces can be declared. None of
 53  
     * the declared namespaces will be made the elements namespace,
 54  
     * instead it will simply declare the namespaces so that the
 55  
     * reference URI and prefix will be made available to children.
 56  
     * 
 57  
     * @return this returns the namespaces that are declared.
 58  
     */
 59  
    Namespace[] value() default {};
 60  
 }