Interface PropertySource<O extends JavaSource<O>>
- Type Parameters:
O-
- All Superinterfaces:
AnnotationTarget<O>,Internal,Named,NamedSource<PropertySource<O>>,Origin<O>,Property<O>
public interface PropertySource<O extends JavaSource<O>>
extends Property<O>, NamedSource<PropertySource<O>>
Source variant of
Property interface.- Author:
- mbenson
-
Method Summary
Modifier and TypeMethodDescriptionCreate the accessor method.Create the storing field.Create the mutator method.Override.getField()Override.Override.Remove the accessor method.Remove the storing field.Remove the mutator method.setAccessible(boolean accessible) Set whether this property is accessible.setMutable(boolean mutable) Set whether this property is mutable.Set the type of thisPropertyto the given type.Methods inherited from interface org.jboss.forge.roaster.model.AnnotationTarget
getAnnotation, getAnnotation, getAnnotations, hasAnnotation, hasAnnotationMethods inherited from interface org.jboss.forge.roaster.Internal
getInternalMethods inherited from interface org.jboss.forge.roaster.model.source.NamedSource
setNameMethods inherited from interface org.jboss.forge.roaster.model.Property
getType, hasField, isAccessible, isMutable
-
Method Details
-
setType
Set the type of thisPropertyto the givenClasstype. Attempt to add an import statement to this Property's basePropertySourceif required. It is the caller's responsibility to create newequals(Object)andhashCode()methods, e.g. by usingRefactory.createHashCodeAndEquals(JavaClassSource, FieldSource[]) -
setType
Set the type of thisPropertyto the given type. Attempt to add an import statement to this Property's basePropertySourceif required. (Note that the given className must be fully-qualified in order to properly import required classes) It is the caller's responsibility to create newequals(Object)andhashCode()methods, e.g. by usingRefactory.createHashCodeAndEquals(JavaClassSource, FieldSource[]) -
setType
Set the type of thisPropertyto the givenJavaType<?>type. Attempt to add an import statement to this field's basePropertySourceif required. It is the caller's responsibility to create newequals(Object)andhashCode()methods, e.g. by usingRefactory.createHashCodeAndEquals(JavaClassSource, FieldSource[]) -
createAccessor
MethodSource<O> createAccessor()Create the accessor method.- Throws:
IllegalStateException- if property name unset or method already exists
-
getAccessor
MethodSource<O> getAccessor()Override.- Specified by:
getAccessorin interfaceProperty<O extends JavaSource<O>>
-
removeAccessor
PropertySource<O> removeAccessor()Remove the accessor method. -
createMutator
MethodSource<O> createMutator()Create the mutator method.- Throws:
IllegalStateException- if property name unset or method already exists
-
getMutator
MethodSource<O> getMutator()Override.- Specified by:
getMutatorin interfaceProperty<O extends JavaSource<O>>
-
removeMutator
PropertySource<O> removeMutator()Remove the mutator method. -
setAccessible
Set whether this property is accessible. -
setMutable
Set whether this property is mutable. -
createField
FieldSource<O> createField()Create the storing field.- Throws:
IllegalStateException- if property name unset or method already exists
-
getField
FieldSource<O> getField()Override.- Specified by:
getFieldin interfaceProperty<O extends JavaSource<O>>
-
removeField
PropertySource<O> removeField()Remove the storing field.
-