KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > hivemind > xml > definition > impl > XmlModuleDefinitionImpl


1 // Copyright 2007 The Apache Software Foundation
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14

15 package org.apache.hivemind.xml.definition.impl;
16
17 import java.util.ArrayList JavaDoc;
18 import java.util.Collection JavaDoc;
19 import java.util.HashMap JavaDoc;
20 import java.util.Map JavaDoc;
21
22 import org.apache.hivemind.ClassResolver;
23 import org.apache.hivemind.Location;
24 import org.apache.hivemind.definition.impl.ModuleDefinitionImpl;
25 import org.apache.hivemind.impl.SchemaAssignment;
26 import org.apache.hivemind.schema.Schema;
27
28 public class XmlModuleDefinitionImpl extends ModuleDefinitionImpl
29 {
30     /**
31      * Map of {@link Schema} keyed on schema id.
32      */

33     private Map JavaDoc _schemas = new HashMap JavaDoc();
34     
35     /**
36      * Collection of {@link SchemaAssignment}s
37      */

38     private Collection JavaDoc _schemaAssignments = new ArrayList JavaDoc();
39
40     public XmlModuleDefinitionImpl(String JavaDoc id, Location location, ClassResolver resolver, String JavaDoc packageName)
41     {
42         super(id, location, resolver, packageName);
43     }
44
45     public void addSchema(String JavaDoc qualifiedSchemaId, Schema schema)
46     {
47         _schemas.put(qualifiedSchemaId, schema);
48     }
49
50     public Schema getSchema(String JavaDoc qualifiedSchemaId)
51     {
52         return (Schema) _schemas.get(qualifiedSchemaId);
53     }
54     
55     public Collection JavaDoc getSchemas()
56     {
57         return _schemas.values();
58     }
59
60     public void addSchemaAssignment(SchemaAssignment assignment)
61     {
62         _schemaAssignments.add(assignment);
63     }
64     
65     public Collection JavaDoc getSchemaAssignments()
66     {
67         return _schemaAssignments;
68     }
69
70 }
71
Popular Tags