Class CReferencePropertyInfo

    • Constructor Detail

      • CReferencePropertyInfo

        public CReferencePropertyInfo​(java.lang.String name,
                                      boolean collection,
                                      boolean required,
                                      boolean isMixed,
                                      XSComponent source,
                                      CCustomizations customizations,
                                      org.xml.sax.Locator locator,
                                      boolean dummy,
                                      boolean content,
                                      boolean isMixedExtended)
    • Method Detail

      • getElements

        public java.util.Set<CElement> getElements()
        Description copied from interface: ReferencePropertyInfo
        Returns the information about the possible elements in this property.

        As of 2004/08/17, the spec only allows you to use different element names when a property is a collection, but I think there's really no reason to limit it there --- if the user wants to use a different tag name for different objects, I don't see why this can be limited to collections.

        So this is a generalization of the spec. We always allow a property to have multiple types and use different tag names for it, depending on the actual type.

        In most of the cases, this collection only contains 1 item. So the runtime system is encouraged to provide a faster code-path that is optimized toward such cases.

        Specified by:
        getElements in interface ReferencePropertyInfo<NType,​NClass>
        Returns:
        Always non-null. Contains at least one entry.
      • isDummy

        public boolean isDummy()
      • isContent

        public boolean isContent()
      • isMixedExtendedCust

        public boolean isMixedExtendedCust()
      • getXmlName

        @Deprecated
        public javax.xml.namespace.QName getXmlName()
        Deprecated.
        We'll never use a wrapper element in XJC. Always return null.
        Specified by:
        getXmlName in interface ReferencePropertyInfo<NType,​NClass>
        Returns:
        must be null if not collection. If the property is a collection, this can be null (in which case there'll be no wrapper), or it can be non-null (in which case there'll be a wrapper)
      • isUnboxable

        public boolean isUnboxable()
        Reference properties refer to elements, and none of the Java primitive type maps to an element. Thus a reference property is always unboxable.
        Overrides:
        isUnboxable in class CPropertyInfo
      • isOptionalPrimitive

        public boolean isOptionalPrimitive()
        Description copied from class: CPropertyInfo
        Returns true if this property needs to represent null just for the purpose of representing an absence of the property.
        Overrides:
        isOptionalPrimitive in class CPropertyInfo
      • id

        public ID id()
        A reference property can never be ID/IDREF because they always point to other element classes.
        Specified by:
        id in interface PropertyInfo<NType,​NClass>
        Returns:
        always non-null
        See Also:
        XmlID, XmlIDREF
      • setWildcard

        public void setWildcard​(WildcardMode mode)
      • isCollectionNillable

        public boolean isCollectionNillable()
        Description copied from interface: ReferencePropertyInfo
        Returns true if this property is nillable (meaning the absence of the value is treated as nil='true')

        This method is only used when this property is a collection.

        Specified by:
        isCollectionNillable in interface ReferencePropertyInfo<NType,​NClass>
      • getSchemaType

        public javax.xml.namespace.QName getSchemaType()
        Description copied from interface: PropertyInfo
        The effective value of XmlSchemaType annotation, if any.

        If the property doesn't have XmlSchemaType annotation, this method returns null.

        Since a type name is a property of a Java type, not a Java property, A schema type name of a Java type should be primarily obtained by using NonElement.getTypeName(). This method is to correctly implement the ugly semantics of XmlSchemaType (namely when this returns non-null, it overrides the type names of all types that are in this property.)

        Specified by:
        getSchemaType in interface PropertyInfo<NType,​NClass>
      • collectElementNames

        public javax.xml.namespace.QName collectElementNames​(java.util.Map<javax.xml.namespace.QName,​CPropertyInfo> table)
        Description copied from class: CPropertyInfo
        Puts the element names that this property possesses to the map, so that we can find two properties that own the same element name, which is an error.
        Overrides:
        collectElementNames in class CPropertyInfo
        Returns:
        null if no conflict was found. Otherwise return the QName that has the collision.