325N/A/*
325N/A * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
325N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
325N/A *
325N/A * This code is free software; you can redistribute it and/or modify it
325N/A * under the terms of the GNU General Public License version 2 only, as
325N/A * published by the Free Software Foundation. Oracle designates this
325N/A * particular file as subject to the "Classpath" exception as provided
325N/A * by Oracle in the LICENSE file that accompanied this code.
325N/A *
325N/A * This code is distributed in the hope that it will be useful, but WITHOUT
325N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
325N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
325N/A * version 2 for more details (a copy is included in the LICENSE file that
325N/A * accompanied this code).
325N/A *
325N/A * You should have received a copy of the GNU General Public License version
325N/A * 2 along with this work; if not, write to the Free Software Foundation,
325N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
325N/A *
325N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
325N/A * or visit www.oracle.com if you need additional information or have any
325N/A * questions.
325N/A */
325N/A
325N/Apackage com.sun.tools.internal.xjc.reader.xmlschema.ct;
325N/A
325N/Aimport com.sun.tools.internal.xjc.ErrorReceiver;
325N/Aimport com.sun.tools.internal.xjc.reader.Ring;
325N/Aimport com.sun.tools.internal.xjc.reader.xmlschema.BGMBuilder;
325N/Aimport com.sun.tools.internal.xjc.reader.xmlschema.BindGreen;
325N/Aimport com.sun.tools.internal.xjc.reader.xmlschema.ClassSelector;
325N/Aimport com.sun.tools.internal.xjc.reader.xmlschema.SimpleTypeBuilder;
325N/Aimport com.sun.xml.internal.xsom.XSComplexType;
325N/Aimport com.sun.xml.internal.xsom.XSSchemaSet;
325N/A
325N/A/**
325N/A * Builds a field expression from a complex type.
325N/A *
325N/A * Depending on a "kind" of complex type, the binding is
325N/A * quite different. For example, how a complex type is bound
325N/A * when it is extended from another complex type is very
325N/A * different from how it's bound when it has, say, mixed content model.
325N/A *
325N/A * Each different algorithm of binding a complex type is implemented
325N/A * as an implementation of this interface.
325N/A *
325N/A * @author
325N/A * Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com)
325N/A */
325N/Aabstract class CTBuilder {
325N/A /**
325N/A * Returns true if this owner can handle the given complex type.
325N/A */
325N/A abstract boolean isApplicable(XSComplexType ct);
325N/A
325N/A /**
325N/A * Binds the given complex type. This method will be called
325N/A * only when the <code>isApplicable</code> method returns true.
325N/A */
325N/A abstract void build(XSComplexType ct);
325N/A
325N/A protected final ComplexTypeFieldBuilder builder = Ring.get(ComplexTypeFieldBuilder.class);
325N/A protected final ClassSelector selector = Ring.get(ClassSelector.class);
325N/A protected final SimpleTypeBuilder simpleTypeBuilder = Ring.get(SimpleTypeBuilder.class);
325N/A protected final ErrorReceiver errorReceiver = Ring.get(ErrorReceiver.class);
325N/A protected final BindGreen green = Ring.get(BindGreen.class);
325N/A protected final XSSchemaSet schemas = Ring.get(XSSchemaSet.class);
325N/A protected final BGMBuilder bgmBuilder = Ring.get(BGMBuilder.class);
325N/A}