Top Description Methods
org.glassfish.jaxb.core.v2.model.core

public Interface PropertyInfo<T, C>

extends AnnotationSource
Known Direct Subinterfaces
org.glassfish.jaxb.core.v2.model.core.ReferencePropertyInfo, org.glassfish.jaxb.core.v2.model.core.ValuePropertyInfo, org.glassfish.jaxb.runtime.v2.model.runtime.RuntimePropertyInfo, org.glassfish.jaxb.core.v2.model.core.AttributePropertyInfo, org.glassfish.jaxb.core.v2.model.core.ElementPropertyInfo, org.glassfish.jaxb.core.v2.model.core.MapPropertyInfo
Known Direct Implementers
org.glassfish.jaxb.runtime.v2.model.impl.PropertyInfoImpl, com.sun.tools.xjc.model.CPropertyInfo
Imports
java.util.Collection, jakarta.activation.MimeType, jakarta.xml.bind.annotation.XmlID, .XmlIDREF, .XmlType, .XmlSchemaType, javax.xml.namespace.QName, com.sun.istack.Nullable, org.glassfish.jaxb.core.v2.model.annotation.AnnotationSource

Information about a JAXB-bound property.

All the JAXB annotations are already incorporated into the model so that the caller doesn't have to worry about reading them. For this reason, you cannot access annotations on properties directly.

Todo

don't we need a visitor?

Author
Kohsuke Kawaguchi

Method Summary

Modifier and TypeMethod and Description
public String
displayName()

Gets the display name of the property.

public Adapter<T, C>
getAdapter()

Returns: null if the property is not adapted.

public MimeType
getExpectedMimeType()

Expected MIME type, if any.

public String
getName()

Gets the name of the property.

public QName
getSchemaType()

The effective value of XmlSchemaType annotation, if any.

public ID

Returns:

always non-null
id
()

Returns the IDness of the value of this element.

public boolean
inlineBinaryData()

If this is true and this property indeed represents a binary data, it should be always inlined.

public boolean
isCollection()

Returns true if this is a multi-valued collection property.

public PropertyKind

Returns:

always non-null.
kind
()

Gets the kind of this property.

public TypeInfo<T, C>
parent()

Gets the ClassInfo or ElementInfo to which this property belongs.

public Collection<? extends TypeInfo<T, C>>

Returns:

non-null read-only collection.
ref
()

List of TypeInfos that this property references.

Inherited from org.glassfish.jaxb.core.v2.model.annotation.AnnotationSource:
hasAnnotationreadAnnotation

Method Detail

displayNameback to summary
public String displayName()

Gets the display name of the property.

This is a convenience method for parent().getName()+'#'+getName().

getAdapterback to summary
public Adapter<T, C> getAdapter()
Returns:Adapter<T, C>

null if the property is not adapted.

getExpectedMimeTypeback to summary
public MimeType getExpectedMimeType()

Expected MIME type, if any.

getNameback to summary
public String getName()

Gets the name of the property.

For example, "foo" or "bar". Generally, a property name is different from XML, (although they are often related, as a property name is often computed from tag names / attribute names.) In fact, property names do not directly affect XML. The property name uniquely identifies a property within a class.

See Also
XmlType#propOrder()
getSchemaTypeback to summary
public QName getSchemaType()

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.)

Annotations
@Nullable
idback to summary
public ID id()

Returns the IDness of the value of this element.

Returns:ID

always non-null

See Also
XmlID, XmlIDREF
inlineBinaryDataback to summary
public boolean inlineBinaryData()

If this is true and this property indeed represents a binary data, it should be always inlined.

isCollectionback to summary
public boolean isCollection()

Returns true if this is a multi-valued collection property. Otherwise false, in which case the property is a single value.

kindback to summary
public PropertyKind kind()

Gets the kind of this property.

Returns:PropertyKind

always non-null.

parentback to summary
public TypeInfo<T, C> parent()

Gets the ClassInfo or ElementInfo to which this property belongs.

refback to summary
public Collection<? extends TypeInfo<T, C>> ref()

List of TypeInfos that this property references. This allows the caller to traverse the reference graph without getting into the details of each different property type.

Returns:Collection<? extends TypeInfo<T, C>>

non-null read-only collection.