Class PropertyImpl
- java.lang.Object
 - 
- org.apache.xmlbeans.impl.jam.internal.elements.ElementImpl
 - 
- org.apache.xmlbeans.impl.jam.internal.elements.AnnotatedElementImpl
 - 
- org.apache.xmlbeans.impl.jam.internal.elements.PropertyImpl
 
 
 
 
- 
- All Implemented Interfaces:
 java.lang.Comparable,JAnnotatedElement,JElement,JProperty,MAnnotatedElement,MElement
public class PropertyImpl extends AnnotatedElementImpl implements JProperty
Implementation of JProperty.
 
- 
- 
Field Summary
- 
Fields inherited from class org.apache.xmlbeans.impl.jam.internal.elements.ElementImpl
NO_ANNOTATION, NO_CLASS, NO_COMMENT, NO_CONSTRUCTOR, NO_FIELD, NO_METHOD, NO_NODE, NO_PACKAGE, NO_PARAMETER, NO_PROPERTY 
 - 
 
- 
Constructor Summary
Constructors Constructor Description PropertyImpl(java.lang.String name, JMethod getter, JMethod setter, java.lang.String qualifiedTypeName)You'll usually want to use the getProperties() factory method instead of constructing JProperties yourself. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(JVisitor visitor)Accepts the given visitor.voidaccept(MVisitor visitor)JAnnotationgetAnnotation(java.lang.String named)Returns the first annotation with the given name that is found on this property's getter and/or setters.JAnnotation[]getAnnotations()Returns all of the annotations on the getter and/or the setter methods.JCommentgetComment()Returns the comment associated with this abstraction.JMethodgetGetter()Returns a JMethod which represents the getter for this property.java.lang.StringgetQualifiedName()Returns the simple name of this property.JMethodgetSetter()Returns a JMethod which represents the setter for this property.java.lang.StringgetSimpleName()Returns the simple name of this property.JSourcePositiongetSourcePosition()Returns an object describing the source file position of this elements, or null if the position is unknown on not applicable.JClassgetType()Returns a JClass which represents the type of this property.voidsetGetter(JMethod method)voidsetSetter(JMethod method)Returns annotations with the given name that are found on this property's getter and/or setter.java.lang.StringtoString()Returns the same String as getQualifiedName().- 
Methods inherited from class org.apache.xmlbeans.impl.jam.internal.elements.AnnotatedElementImpl
addAnnotationForProxy, addLiteralAnnotation, createComment, findOrCreateAnnotation, getAllJavadocTags, getAnnotation, getAnnotationProxy, getAnnotationValue, getEditableProxy, getMutableAnnotation, getMutableAnnotations, getMutableComment, removeAnnotation, removeComment 
- 
Methods inherited from class org.apache.xmlbeans.impl.jam.internal.elements.ElementImpl
compareTo, createSourcePosition, defaultName, equals, getArtifact, getClassLoader, getContext, getMutableSourcePosition, getParent, hashCode, removeSourcePosition, setArtifact, setSimpleName 
- 
Methods inherited from interface org.apache.xmlbeans.impl.jam.JAnnotatedElement
getAllJavadocTags, getAnnotation, getAnnotationProxy, getAnnotationValue 
- 
Methods inherited from interface org.apache.xmlbeans.impl.jam.JElement
getArtifact, getParent 
- 
Methods inherited from interface org.apache.xmlbeans.impl.jam.mutable.MElement
createSourcePosition, getClassLoader, getMutableSourcePosition, removeSourcePosition, setArtifact, setSimpleName 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
PropertyImpl
public PropertyImpl(java.lang.String name, JMethod getter, JMethod setter, java.lang.String qualifiedTypeName)You'll usually want to use the getProperties() factory method instead of constructing JProperties yourself. This constructor is exposed just in case the default rules in the factory method for identifying properties are insufficient for some use case.
 
 - 
 
- 
Method Detail
- 
getType
public JClass getType()
Returns a JClass which represents the type of this property. 
- 
getSimpleName
public java.lang.String getSimpleName()
Returns the simple name of this property. For example, for a property manifest by getFoo() and setFoo(), this will return 'foo'.- Specified by:
 getSimpleNamein interfaceJElement- Overrides:
 getSimpleNamein classElementImpl
 
- 
getQualifiedName
public java.lang.String getQualifiedName()
Returns the simple name of this property. For example, for a property manifest by getFoo() and setFoo(), this will return 'foo'.- Specified by:
 getQualifiedNamein interfaceJElement
 
- 
getSetter
public JMethod getSetter()
Returns a JMethod which represents the setter for this property. Returns null if this property is view-only. 
- 
getGetter
public JMethod getGetter()
Returns a JMethod which represents the getter for this property. Returns null if this property is write-only. 
- 
getAnnotations
public JAnnotation[] getAnnotations()
Returns all of the annotations on the getter and/or the setter methods.- Specified by:
 getAnnotationsin interfaceJAnnotatedElement- Overrides:
 getAnnotationsin classAnnotatedElementImpl
 
- 
setSetter
public void setSetter(JMethod method)
Returns annotations with the given name that are found on this property's getter and/or setter. public JAnnotation[] getAnnotations(String named) { return combine((mGetter == null) ? BaseJElement.NO_ANNOTATION : mGetter.getAnnotations(named), (mSetter == null) ? BaseJElement.NO_ANNOTATION : mSetter.getAnnotations(named)); } 
- 
setGetter
public void setGetter(JMethod method)
 
- 
getAnnotation
public JAnnotation getAnnotation(java.lang.String named)
Returns the first annotation with the given name that is found on this property's getter and/or setters.- Specified by:
 getAnnotationin interfaceJAnnotatedElement- Overrides:
 getAnnotationin classAnnotatedElementImpl
 
- 
getComment
public JComment getComment()
Description copied from interface:JAnnotatedElementReturns the comment associated with this abstraction. Returns null if it has no comment.
- Specified by:
 getCommentin interfaceJAnnotatedElement- Overrides:
 getCommentin classAnnotatedElementImpl
 
- 
getSourcePosition
public JSourcePosition getSourcePosition()
Description copied from interface:JElementReturns an object describing the source file position of this elements, or null if the position is unknown on not applicable.- Specified by:
 getSourcePositionin interfaceJElement- Overrides:
 getSourcePositionin classElementImpl
 
- 
accept
public void accept(JVisitor visitor)
Description copied from interface:JElementAccepts the given visitor.
 
- 
toString
public java.lang.String toString()
Description copied from interface:JElementReturns the same String as getQualifiedName().
- Specified by:
 toStringin interfaceJElement- Overrides:
 toStringin classElementImpl
 
 - 
 
 -