Top Description Fields Constructors Methods
org.glassfish.jaxb.runtime.v2.model.impl

pack-priv abstract Class PropertyInfoImpl<T, C, F, M>

extends Object
implements PropertyInfo<T, C>, Locatable, Comparable<PropertyInfoImpl<T, C, F, M>>
Class Inheritance
All Implemented Interfaces
java.lang.Comparable, org.glassfish.jaxb.core.v2.model.annotation.Locatable, org.glassfish.jaxb.core.v2.model.core.PropertyInfo, org.glassfish.jaxb.core.v2.model.annotation.AnnotationSource
Known Direct Subclasses
org.glassfish.jaxb.runtime.v2.model.impl.SingleTypePropertyInfoImpl, org.glassfish.jaxb.runtime.v2.model.impl.ERPropertyInfoImpl, org.glassfish.jaxb.runtime.v2.model.impl.MapPropertyInfoImpl
Imports
org.glassfish.jaxb.core.v2.TODO, org.glassfish.jaxb.core.v2.model.annotation.AnnotationReader, .Locatable, org.glassfish.jaxb.core.v2.model.core.*, org.glassfish.jaxb.core.v2.model.nav.Navigator, org.glassfish.jaxb.core.v2.runtime.IllegalAnnotationException, .Location, org.glassfish.jaxb.runtime.v2.runtime.SwaRefAdapter, jakarta.activation.MimeType, jakarta.xml.bind.annotation.*, jakarta.xml.bind.annotation.adapters.XmlAdapter, .XmlJavaTypeAdapter, .XmlJavaTypeAdapters, javax.xml.namespace.QName, java.lang.annotation.Annotation, java.util.Collection

Default partial implementation for PropertyInfo.
Author
Kohsuke Kawaguchi

Field Summary

Modifier and TypeField and Description
private final Adapter<T, C>
private final MimeType
private final ID
private final boolean
private final boolean
protected final ClassInfoImpl<T, C, F, M>
private final QName
protected final PropertySeed<T, C, F, M>
seed

Object that reads annotations.

Constructor Summary

AccessConstructor and Description
protected
PropertyInfoImpl(ClassInfoImpl<T, C, F, M> parent, PropertySeed<T, C, F, M> spi)

Method Summary

Modifier and TypeMethod and Description
private ID
protected final QName
calcXmlName(XmlElement e)

Computes the tag name from a XmlElement by taking the defaulting into account.

protected final QName
calcXmlName(XmlElementWrapper e)

Computes the tag name from a XmlElementWrapper by taking the defaulting into account.

private QName
public int
compareTo(PropertyInfoImpl<T, C, F, M> that)

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.

public final String
displayName()

Implements org.glassfish.jaxb.core.v2.model.core.PropertyInfo.displayName.

Gets the display name of the property.

public Adapter<T, C>
getAdapter()

Implements org.glassfish.jaxb.core.v2.model.core.PropertyInfo.getAdapter.

This is the default implementation of the getAdapter method defined on many of the PropertyInfo-derived classes.

private XmlJavaTypeAdapter
public final MimeType
public T
public Location
getLocation()

Implements org.glassfish.jaxb.core.v2.model.annotation.Locatable.getLocation.

Gets the location object that this object points to.

public final String
getName()

Implements org.glassfish.jaxb.core.v2.model.core.PropertyInfo.getName.

Gets the name of the property.

public T
public final QName
public Locatable
getUpstream()

Implements org.glassfish.jaxb.core.v2.model.annotation.Locatable.getUpstream.

A is always referenced by its enclosing class, so return that as the upstream.

public final boolean
hasAnnotation(Class<? extends Annotation> annotationType)

Implements org.glassfish.jaxb.core.v2.model.annotation.AnnotationSource.hasAnnotation.

Returns true if the property has the specified annotation.

public final ID
id()

Implements org.glassfish.jaxb.core.v2.model.core.PropertyInfo.id.

Returns the IDness of the value of this element.

public final boolean
inlineBinaryData()

Implements org.glassfish.jaxb.core.v2.model.core.PropertyInfo.inlineBinaryData.

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

private boolean
isApplicable(XmlJavaTypeAdapter jta, T declaredType)

Checks if the given adapter is applicable to the declared property type.

public final boolean
isCollection()

Implements org.glassfish.jaxb.core.v2.model.core.PropertyInfo.isCollection.

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

public ClassInfoImpl<T, C, F, M>
parent()

Implements org.glassfish.jaxb.core.v2.model.core.PropertyInfo.parent.

Gets the ClassInfo or ElementInfo to which this property belongs.

public final <A extends Annotation> A
readAnnotation(Class<A> annotationType)

Implements org.glassfish.jaxb.core.v2.model.annotation.AnnotationSource.readAnnotation.

Gets the value of the specified annotation from the given property.

protected final AnnotationReader<T, C, F, M>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

adapterback to summary
private final Adapter<T, C> adapter
expectedMimeTypeback to summary
private final MimeType expectedMimeType
idback to summary
private final ID id
inlineBinaryback to summary
private final boolean inlineBinary
isCollectionback to summary
private final boolean isCollection
parentback to summary
protected final ClassInfoImpl<T, C, F, M> parent
schemaTypeback to summary
private final QName schemaType
seedback to summary
protected final PropertySeed<T, C, F, M> seed

Object that reads annotations.

Constructor Detail

PropertyInfoImplback to summary
protected PropertyInfoImpl(ClassInfoImpl<T, C, F, M> parent, PropertySeed<T, C, F, M> spi)

Method Detail

calcIdback to summary
private ID calcId()
calcXmlNameback to summary
protected final QName calcXmlName(XmlElement e)

Computes the tag name from a XmlElement by taking the defaulting into account.

calcXmlNameback to summary
protected final QName calcXmlName(XmlElementWrapper e)

Computes the tag name from a XmlElementWrapper by taking the defaulting into account.

calcXmlNameback to summary
private QName calcXmlName(String uri, String local)
compareToback to summary
public int compareTo(PropertyInfoImpl<T, C, F, M> that)

Implements java.lang.Comparable.compareTo.

Doc from java.lang.Comparable.compareTo.

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z.

Annotations
@Override
displayNameback to summary
public final String displayName()

Implements org.glassfish.jaxb.core.v2.model.core.PropertyInfo.displayName.

Doc from org.glassfish.jaxb.core.v2.model.core.PropertyInfo.displayName.

Gets the display name of the property.

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

Annotations
@Override
getAdapterback to summary
public Adapter<T, C> getAdapter()

Implements org.glassfish.jaxb.core.v2.model.core.PropertyInfo.getAdapter.

This is the default implementation of the getAdapter method defined on many of the PropertyInfo-derived classes.

Annotations
@Override
getApplicableAdapterback to summary
private XmlJavaTypeAdapter getApplicableAdapter(T type)
getExpectedMimeTypeback to summary
public final MimeType getExpectedMimeType()

Implements org.glassfish.jaxb.core.v2.model.core.PropertyInfo.getExpectedMimeType.

Doc from org.glassfish.jaxb.core.v2.model.core.PropertyInfo.getExpectedMimeType.

Expected MIME type, if any.

Annotations
@Override
getIndividualTypeback to summary
public T getIndividualType()
getLocationback to summary
public Location getLocation()

Implements org.glassfish.jaxb.core.v2.model.annotation.Locatable.getLocation.

Doc from org.glassfish.jaxb.core.v2.model.annotation.Locatable.getLocation.

Gets the location object that this object points to. This operation could be inefficient and costly.

Annotations
@Override
getNameback to summary
public final String getName()

Implements org.glassfish.jaxb.core.v2.model.core.PropertyInfo.getName.

Doc from org.glassfish.jaxb.core.v2.model.core.PropertyInfo.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.

Annotations
@Override
getRawTypeback to summary
public T getRawType()
getSchemaTypeback to summary
public final QName getSchemaType()

Implements org.glassfish.jaxb.core.v2.model.core.PropertyInfo.getSchemaType.

Doc from org.glassfish.jaxb.core.v2.model.core.PropertyInfo.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
@Override
getUpstreamback to summary
public Locatable getUpstream()

Implements org.glassfish.jaxb.core.v2.model.annotation.Locatable.getUpstream.

A is always referenced by its enclosing class, so return that as the upstream.

Annotations
@Override
hasAnnotationback to summary
public final boolean hasAnnotation(Class<? extends Annotation> annotationType)

Implements org.glassfish.jaxb.core.v2.model.annotation.AnnotationSource.hasAnnotation.

Doc from org.glassfish.jaxb.core.v2.model.annotation.AnnotationSource.hasAnnotation.

Returns true if the property has the specified annotation.

Short for readAnnotation(annotationType)!=null, but this method is typically faster.

Annotations
@Override
idback to summary
public final ID id()

Implements org.glassfish.jaxb.core.v2.model.core.PropertyInfo.id.

Doc from org.glassfish.jaxb.core.v2.model.core.PropertyInfo.id.

Returns the IDness of the value of this element.

Annotations
@Override
inlineBinaryDataback to summary
public final boolean inlineBinaryData()

Implements org.glassfish.jaxb.core.v2.model.core.PropertyInfo.inlineBinaryData.

Doc from org.glassfish.jaxb.core.v2.model.core.PropertyInfo.inlineBinaryData.

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

Annotations
@Override
isApplicableback to summary
private boolean isApplicable(XmlJavaTypeAdapter jta, T declaredType)

Checks if the given adapter is applicable to the declared property type.

isCollectionback to summary
public final boolean isCollection()

Implements org.glassfish.jaxb.core.v2.model.core.PropertyInfo.isCollection.

Doc from org.glassfish.jaxb.core.v2.model.core.PropertyInfo.isCollection.

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

Annotations
@Override
parentback to summary
public ClassInfoImpl<T, C, F, M> parent()

Implements org.glassfish.jaxb.core.v2.model.core.PropertyInfo.parent.

Doc from org.glassfish.jaxb.core.v2.model.core.PropertyInfo.parent.

Gets the ClassInfo or ElementInfo to which this property belongs.

Annotations
@Override
readAnnotationback to summary
public final <A extends Annotation> A readAnnotation(Class<A> annotationType)

Implements org.glassfish.jaxb.core.v2.model.annotation.AnnotationSource.readAnnotation.

Doc from org.glassfish.jaxb.core.v2.model.annotation.AnnotationSource.readAnnotation.

Gets the value of the specified annotation from the given property.

When this method is used for a property that consists of a getter and setter, it returns the annotation on either of those methods. If both methods have the same annotation, it is an error.

Annotations
@Override
readerback to summary
protected final AnnotationReader<T, C, F, M> reader()