001: /*
002: * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004: *
005: * This code is free software; you can redistribute it and/or modify it
006: * under the terms of the GNU General Public License version 2 only, as
007: * published by the Free Software Foundation. Sun designates this
008: * particular file as subject to the "Classpath" exception as provided
009: * by Sun in the LICENSE file that accompanied this code.
010: *
011: * This code is distributed in the hope that it will be useful, but WITHOUT
012: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014: * version 2 for more details (a copy is included in the LICENSE file that
015: * accompanied this code).
016: *
017: * You should have received a copy of the GNU General Public License version
018: * 2 along with this work; if not, write to the Free Software Foundation,
019: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022: * CA 95054 USA or visit www.sun.com if you need additional information or
023: * have any questions.
024: */
025:
026: package com.sun.tools.internal.xjc.reader.xmlschema;
027:
028: import java.util.Iterator;
029:
030: import com.sun.tools.internal.xjc.reader.Ring;
031: import com.sun.tools.internal.xjc.reader.xmlschema.ct.ComplexTypeFieldBuilder;
032: import com.sun.xml.internal.xsom.XSAttContainer;
033: import com.sun.xml.internal.xsom.XSAttGroupDecl;
034: import com.sun.xml.internal.xsom.XSAttributeDecl;
035: import com.sun.xml.internal.xsom.XSAttributeUse;
036: import com.sun.xml.internal.xsom.XSComplexType;
037: import com.sun.xml.internal.xsom.XSContentType;
038: import com.sun.xml.internal.xsom.XSElementDecl;
039: import com.sun.xml.internal.xsom.XSModelGroup;
040: import com.sun.xml.internal.xsom.XSModelGroupDecl;
041: import com.sun.xml.internal.xsom.XSParticle;
042: import com.sun.xml.internal.xsom.XSSimpleType;
043: import com.sun.xml.internal.xsom.XSWildcard;
044:
045: /**
046: * @author Kohsuke Kawaguchi
047: */
048: public final class BindGreen extends ColorBinder {
049:
050: private final ComplexTypeFieldBuilder ctBuilder = Ring
051: .get(ComplexTypeFieldBuilder.class);
052:
053: public void attGroupDecl(XSAttGroupDecl ag) {
054: attContainer(ag);
055: }
056:
057: public void attContainer(XSAttContainer cont) {
058: // inline
059: Iterator itr = cont.iterateDeclaredAttributeUses();
060: while (itr.hasNext())
061: builder.ying((XSAttributeUse) itr.next());
062: itr = cont.iterateAttGroups();
063: while (itr.hasNext())
064: builder.ying((XSAttGroupDecl) itr.next());
065:
066: XSWildcard w = cont.getAttributeWildcard();
067: if (w != null)
068: builder.ying(w);
069: }
070:
071: public void complexType(XSComplexType ct) {
072: ctBuilder.build(ct);
073: }
074:
075: public void attributeDecl(XSAttributeDecl xsAttributeDecl) {
076: // TODO: implement this method later
077: throw new UnsupportedOperationException();
078: }
079:
080: public void wildcard(XSWildcard xsWildcard) {
081: // TODO: implement this method later
082: throw new UnsupportedOperationException();
083: }
084:
085: public void modelGroupDecl(XSModelGroupDecl xsModelGroupDecl) {
086: // TODO: implement this method later
087: throw new UnsupportedOperationException();
088: }
089:
090: public void modelGroup(XSModelGroup xsModelGroup) {
091: // TODO: implement this method later
092: throw new UnsupportedOperationException();
093: }
094:
095: public void elementDecl(XSElementDecl xsElementDecl) {
096: // TODO: implement this method later
097: throw new UnsupportedOperationException();
098: }
099:
100: public void particle(XSParticle xsParticle) {
101: // TODO: implement this method later
102: throw new UnsupportedOperationException();
103: }
104:
105: public void empty(XSContentType xsContentType) {
106: // TODO: implement this method later
107: throw new UnsupportedOperationException();
108: }
109:
110: /*
111:
112: Components for which ying should yield to purple.
113:
114: */
115: public void simpleType(XSSimpleType xsSimpleType) {
116: // simple type always maps to a type, so this is never possible
117: throw new IllegalStateException();
118: }
119:
120: public void attributeUse(XSAttributeUse use) {
121: // attribute use always maps to a property
122: throw new IllegalStateException();
123: }
124: }
|