KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > codehaus > loom > components > util > info > SchemaDescriptor


1 /*
2  * Copyright (C) The Loom Group. All rights reserved.
3  *
4  * This software is published under the terms of the Loom
5  * Software License version 1.1, a copy of which has been included
6  * with this distribution in the LICENSE.txt file.
7  */

8 package org.codehaus.loom.components.util.info;
9
10 /**
11  * A descriptor describing the schema to validate the components {@link
12  * org.apache.avalon.framework.parameters.Parameters} or {@link
13  * org.apache.avalon.framework.configuration.Configuration} object. If a
14  * component is neither {@link org.apache.avalon.framework.parameters.Parameterizable}
15  * nor {@link org.apache.avalon.framework.configuration.Configurable} then this
16  * descriptor will hold empty values for location, category and type.
17  *
18  * <p>Associated with each Schema is a set of arbitrary Attributes that can be
19  * used to store extra information about Schema requirements.</p>
20  *
21  * @author Peter Donald
22  * @version $Revision: 1.2 $ $Date: 2004/05/01 12:48:34 $
23  */

24 public class SchemaDescriptor
25 {
26     /** The location of schema relative to component. */
27     private final String JavaDoc m_location;
28
29     /** The type of the schema. */
30     private final String JavaDoc m_type;
31
32     /**
33      * Create a Schema descriptor.
34      *
35      * @param location the location of schema relative to component
36      * @param type the type of the schema
37      */

38     public SchemaDescriptor( final String JavaDoc location,
39                              final String JavaDoc type )
40     {
41         if( null == location )
42         {
43             throw new NullPointerException JavaDoc( "location" );
44         }
45         if( null == type )
46         {
47             throw new NullPointerException JavaDoc( "type" );
48         }
49
50         m_location = location;
51         m_type = type;
52     }
53
54     /**
55      * Return the location of the schema relative to the component.
56      *
57      * @return the location of the schema relative to the component.
58      */

59     public String JavaDoc getLocation()
60     {
61         return m_location;
62     }
63
64     /**
65      * Return the type of the schema. Usually represented as a URI referring to
66      * schema namespace declaration.
67      *
68      * @return the type of the schema
69      */

70     public String JavaDoc getType()
71     {
72         return m_type;
73     }
74 }
75
Popular Tags