01: /*
02: * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
03: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
04: *
05: * This code is free software; you can redistribute it and/or modify it
06: * under the terms of the GNU General Public License version 2 only, as
07: * published by the Free Software Foundation. Sun designates this
08: * particular file as subject to the "Classpath" exception as provided
09: * by Sun in the LICENSE file that accompanied this code.
10: *
11: * This code is distributed in the hope that it will be useful, but WITHOUT
12: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14: * version 2 for more details (a copy is included in the LICENSE file that
15: * accompanied this code).
16: *
17: * You should have received a copy of the GNU General Public License version
18: * 2 along with this work; if not, write to the Free Software Foundation,
19: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20: *
21: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22: * CA 95054 USA or visit www.sun.com if you need additional information or
23: * have any questions.
24: */
25:
26: package com.sun.xml.internal.xsom;
27:
28: import java.util.Iterator;
29: import java.util.Collection;
30: import java.util.List;
31:
32: /**
33: * Restriction simple type.
34: *
35: * @author
36: * Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
37: */
38: public interface XSRestrictionSimpleType extends XSSimpleType {
39: // TODO
40:
41: /** Iterates facets that are specified in this step of derivation. */
42: public Iterator<XSFacet> iterateDeclaredFacets();
43:
44: public Collection<? extends XSFacet> getDeclaredFacets();
45:
46: /**
47: * Gets the declared facet object of the given name.
48: *
49: * <p>
50: * This method returns a facet object that is added in this
51: * type and does not recursively check the ancestors.
52: *
53: * <p>
54: * For those facets that can have multiple values
55: * (pattern facets and enumeration facets), this method
56: * will return only the first one.
57: *
58: * @return
59: * Null if the facet is not specified in the last step
60: * of derivation.
61: */
62: XSFacet getDeclaredFacet(String name);
63:
64: /**
65: * Gets the declared facets of the given name.
66: *
67: * This method is for those facets (such as 'pattern') that
68: * can be specified multiple times on a simple type.
69: *
70: * @return
71: * can be empty but never be null.
72: */
73: List<XSFacet> getDeclaredFacets(String name);
74: }
|