001/*
002 * NamespaceList.java July 2008
003 *
004 * Copyright (C) 2008, Niall Gallagher <niallg@users.sf.net>
005 *
006 * Licensed under the Apache License, Version 2.0 (the "License");
007 * you may not use this file except in compliance with the License.
008 * You may obtain a copy of the License at
009 *
010 *     http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing, software
013 * distributed under the License is distributed on an "AS IS" BASIS,
014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 
015 * implied. See the License for the specific language governing 
016 * permissions and limitations under the License.
017 */
018
019package org.simpleframework.xml;
020
021import java.lang.annotation.Retention;
022import java.lang.annotation.RetentionPolicy;
023
024/**
025 * The <code>NamespaceList</code> annotation that is used to declare
026 * namespaces that can be added to an element. This is used when 
027 * there are several namespaces to add to the element without setting
028 * any namespace to the element. This is useful when the scope of a
029 * namespace needs to span several nodes. All prefixes declared in 
030 * the namespaces will be available to the child nodes.
031 * <pre>
032 * 
033 *    &lt;example xmlns:root="http://www.example.com/root"&gt;
034 *       &lt;anonymous&gt;anonymous element&lt;/anonymous&gt;
035 *    &lt;/example&gt;
036 *    
037 * </pre>
038 * The above XML example shows how a prefixed namespace has been added
039 * to the element without qualifying that element. Such declarations
040 * will allow child elements to pick up the parents prefix when this
041 * is required, this avoids having to redeclare the same namespace.
042 * 
043 * @author Niall Gallagher
044 *
045 * @see org.simpleframework.xml.Namespace
046 */
047@Retention(RetentionPolicy.RUNTIME)
048public @interface NamespaceList {
049
050   /**
051    * This is used to acquire the namespaces that are declared on
052    * the class. Any number of namespaces can be declared. None of
053    * the declared namespaces will be made the elements namespace,
054    * instead it will simply declare the namespaces so that the
055    * reference URI and prefix will be made available to children.
056    * 
057    * @return this returns the namespaces that are declared.
058    */
059   Namespace[] value() default {};
060}