Class CClassInfo

    • Field Detail

      • javadoc

        public String javadoc
        TODO: revisit this design. we should at least do a basic encapsulation to avoid careless mistakes. Maybe we should even differ the javadoc generation by queueing runners.
      • shortName

        public final String shortName
        short name.
      • model

        public final Model model
        The Model object to which this bean belongs.
    • Method Detail

      • hasAttributeWildcard

        public void hasAttributeWildcard​(boolean hasAttributeWildcard)
      • declaresAttributeWildcard

        public boolean declaresAttributeWildcard()
        Returns true if a new attribute wildcard property needs to be declared on this class.
        Specified by:
        declaresAttributeWildcard in interface ClassInfo<NType,​NClass>
      • inheritsAttributeWildcard

        public boolean inheritsAttributeWildcard()
        Returns true if this class inherits a wildcard attribute property from its ancestor classes.
        Specified by:
        inheritsAttributeWildcard in interface ClassInfo<NType,​NClass>
      • getSqueezedName

        public String getSqueezedName()
        Returns the "squeezed name" of this bean token.

        The squeezed name of a bean is the concatenation of the names of its outer classes and itself.

        Thus if the bean is "org.acme.foo.Bean", then the squeezed name is "Bean", if the bean is "org.acme.foo.Outer1.Outer2.Bean", then "Outer1Outer2Bean".

        This is used by the code generator

      • isElement

        public boolean isElement()
        Description copied from interface: MaybeElement
        If the class is bound to an element, return true.

        Note that when this is true, the class is bound to both an element and a type.

        Specified by:
        isElement in interface MaybeElement<NType,​NClass>
      • isOrdered

        public boolean isOrdered()
        Description copied from interface: ClassInfo
        Returns true if the properties of this class is ordered in XML. False if it't not.

        In RELAX NG context, ordered properties mean <group> and unordered properties mean <interleave>.

        Specified by:
        isOrdered in interface ClassInfo<NType,​NClass>
      • isFinal

        public boolean isFinal()
        Deprecated.
        if you are calling this method directly, you must be doing something wrong.
        Description copied from interface: ClassInfo
        If this class is marked as final and no further extension/restriction is allowed.
        Specified by:
        isFinal in interface ClassInfo<NType,​NClass>
      • setOrdered

        public void setOrdered​(boolean value)
      • getTypeName

        public QName getTypeName()
        Description copied from interface: NonElement
        Gets the primary XML type ANYTYPE_NAME of the class.

        A Java type can be mapped to multiple XML types, but one of them is considered "primary" and used when we generate a schema.

        Specified by:
        getTypeName in interface NonElement<NType,​NClass>
        Returns:
        null if the object doesn't have an explicit type ANYTYPE_NAME (AKA anonymous.)
      • setUserSpecifiedImplClass

        public void setUserSpecifiedImplClass​(String implClass)
      • getUserSpecifiedImplClass

        public String getUserSpecifiedImplClass()
      • addProperty

        public void addProperty​(CPropertyInfo prop)
        Adds a new property.
      • setBaseClass

        public void setBaseClass​(CClass base)
        This method accepts both CClassInfo (which means the base class is also generated), or CClassRef (which means the base class is already generated and simply referenced.) The latter is treated somewhat special --- from the rest of the model this external base class is invisible. This modeling might need more thoughts to get right.
      • getRefBaseClass

        public CClassRef getRefBaseClass()
      • listSubclasses

        public Iterator<CClassInfo> listSubclasses()
        Enumerates all the sub-classes of this class.
      • getSubstitutionHead

        public CClassInfo getSubstitutionHead()
        Description copied from interface: Element
        If this element can substitute another element, return that element.

        Substitutability of elements are transitive.

        Specified by:
        getSubstitutionHead in interface Element<NType,​NClass>
        Returns:
        null if no such element exists.
      • _implements

        public void _implements​(JClass c)
      • addConstructor

        public void addConstructor​(String... fieldNames)
        Creates a new constructor declaration and adds it.
      • getConstructors

        public Collection<? extends Constructor> getConstructors()
        list all constructor declarations.
      • getType

        public final NClass getType()
        Description copied from interface: TypeInfo
        Gets the underlying Java type that object represents.
        Specified by:
        getType in interface TypeInfo<NType,​NClass>
        Returns:
        always non-null.
      • isBoxedType

        public boolean isBoxedType()
        Description copied from interface: NType
        Returns true iff this type represents a class that has a unboxed form. For example, for String this is false, but for Integer this is true.
        Specified by:
        isBoxedType in interface NType
      • getLocator

        public Locator getLocator()
        Description copied from interface: CCustomizable
        Gets the source location in the schema from which this model component is created.
        Specified by:
        getLocator in interface CCustomizable
        Returns:
        never null.
      • isAbstract

        public boolean isAbstract()
        Description copied from interface: CElement
        Returns true iff this element is an abstract element.
        Specified by:
        isAbstract in interface CElement
      • setAbstract

        public void setAbstract()
        Description copied from interface: CElement
        Marks this element as an abstract element.
        Specified by:
        setAbstract in interface CElement
      • isCollection

        public final boolean isCollection()
      • getAdapterUse

        public final CAdapter getAdapterUse()
      • idUse

        public final ID idUse()
      • getSchemaComponent

        public final XSComponent getSchemaComponent()
        Description copied from interface: CCustomizable
        If this model object is built from XML Schema, this property returns a schema component from which the model is built.
        Specified by:
        getSchemaComponent in interface CCustomizable
        Returns:
        null if the model is built from sources other than XML Schema (such as DTD.)
      • canBeReferencedByIDREF

        public final boolean canBeReferencedByIDREF()
        Deprecated.
        why are you calling an unimplemented method?
        Description copied from interface: TypeInfo
        True if this type is a valid target from a property annotated with XmlIDREF.
        Specified by:
        canBeReferencedByIDREF in interface TypeInfo<NType,​NClass>
      • getExpectedMimeType

        public MimeType getExpectedMimeType()
        No default MimeType.
      • getLocation

        public final Location getLocation()
        Description copied from interface: Locatable
        Gets the location object that this object points to. This operation could be inefficient and costly.
        Specified by:
        getLocation in interface Locatable