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.xml.internal.bind.v2.model.core;
325N/A
325N/Aimport java.util.List;
325N/A
325N/Aimport javax.xml.bind.annotation.XmlTransient;
325N/Aimport javax.xml.bind.annotation.XmlValue;
325N/A
325N/A/**
325N/A * Information about JAXB-bound class.
325N/A *
325N/A * <p>
325N/A * All the JAXB annotations are already reflected to the model so that
325N/A * the caller doesn't have to worry about them. For this reason, you
325N/A * cannot access annotations on properties.
325N/A *
325N/A * <h2>XML representation</h2>
325N/A * <p>
325N/A * A JAXB-bound class always have at least one representation
325N/A * (called "type representation"),but it can optionally have another
325N/A * representation ("element representation").
325N/A *
325N/A * <p>
325N/A * In the type representaion, a class
325N/A * is represented as a set of attributes and (elements or values).
325N/A * You can inspect the details of those attributes/elements/values by {@link #getProperties()}.
325N/A * This representation corresponds to a complex/simple type in XML Schema.
325N/A * You can obtain the schema type name by {@link #getTypeName()}.
325N/A *
325N/A * <p>
325N/A * If a class has an element representation, {@link #isElement()} returns true.
325N/A * This representation is mostly similar to the type representation
325N/A * except that the whoe attributes/elements/values are wrapped into
325N/A * one element. You can obtain the name of this element through {@link #asElement()}.
325N/A *
325N/A * @author Kohsuke Kawaguchi (kk@kohsuke.org)
325N/A */
325N/Apublic interface ClassInfo<T,C> extends MaybeElement<T,C> {
325N/A
325N/A /**
325N/A * Obtains the information about the base class.
325N/A *
325N/A * @return null
325N/A * if this info extends from {@link Object}.
325N/A */
325N/A ClassInfo<T,C> getBaseClass();
325N/A
325N/A /**
325N/A * Gets the declaration this object is wrapping.
325N/A */
325N/A C getClazz();
325N/A
325N/A /**
325N/A * Gets the fully-qualified name of the class.
325N/A */
325N/A String getName();
325N/A
325N/A /**
325N/A * Returns all the properties newly declared in this class.
325N/A *
325N/A * <p>
325N/A * This excludes properties defined in the super class.
325N/A *
325N/A * <p>
325N/A * If the properties are {@link #isOrdered() ordered},
325N/A * it will be returned in the order that appear in XML.
325N/A * Otherwise it will be returned in no particular order.
325N/A *
325N/A * <p>
325N/A * Properties marked with {@link XmlTransient} will not show up
325N/A * in this list. As far as JAXB is concerned, they are considered
325N/A * non-existent.
325N/A *
325N/A * @return
325N/A * always non-null, but can be empty.
325N/A */
325N/A List<? extends PropertyInfo<T,C>> getProperties();
325N/A
325N/A /**
325N/A * Returns true if this class or its ancestor has {@link XmlValue}
325N/A * property.
325N/A */
325N/A boolean hasValueProperty();
325N/A
325N/A /**
325N/A * Gets the property that has the specified name.
325N/A *
325N/A * <p>
325N/A * This is just a convenience method for:
325N/A * <pre>
325N/A * for( PropertyInfo p : getProperties() ) {
325N/A * if(p.getName().equals(name))
325N/A * return p;
325N/A * }
325N/A * return null;
325N/A * </pre>
325N/A *
325N/A * @return null
325N/A * if the property was not found.
325N/A *
325N/A * @see PropertyInfo#getName()
325N/A */
325N/A PropertyInfo<T,C> getProperty(String name);
325N/A
325N/A /**
325N/A * If the class has properties, return true. This is only
325N/A * true if the Collection object returned by {@link #getProperties()}
325N/A * is not empty.
325N/A */
325N/A boolean hasProperties();
325N/A
325N/A /**
325N/A * If this class is abstract and thus shall never be directly instanciated.
325N/A */
325N/A boolean isAbstract();
325N/A
325N/A /**
325N/A * Returns true if the properties of this class is ordered in XML.
325N/A * False if it't not.
325N/A *
325N/A * <p>
325N/A * In RELAX NG context, ordered properties mean &lt;group> and
325N/A * unordered properties mean &lt;interleave>.
325N/A */
325N/A boolean isOrdered();
325N/A
325N/A /**
325N/A * If this class is marked as final and no further extension/restriction is allowed.
325N/A */
325N/A boolean isFinal();
325N/A
325N/A /**
325N/A * True if there's a known sub-type of this class in {@link TypeInfoSet}.
325N/A */
325N/A boolean hasSubClasses();
325N/A
325N/A /**
325N/A * Returns true if this bean class has an attribute wildcard.
325N/A *
325N/A * <p>
325N/A * This is true if the class declares an attribute wildcard,
325N/A * or it is inherited from its super classes.
325N/A *
325N/A * @see #inheritsAttributeWildcard()
325N/A */
325N/A boolean hasAttributeWildcard();
325N/A
325N/A /**
325N/A * Returns true iff this class inherits a wildcard attribute
325N/A * from its ancestor classes.
325N/A */
325N/A boolean inheritsAttributeWildcard();
325N/A
325N/A /**
325N/A * Returns true iff this class declares a wildcard attribute.
325N/A */
325N/A boolean declaresAttributeWildcard();
325N/A}