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 ofPropertyinterface.- Author:
- mbenson
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MethodSource<O>createAccessor()Create the accessor method.FieldSource<O>createField()Create the storing field.MethodSource<O>createMutator()Create the mutator method.MethodSource<O>getAccessor()Override.FieldSource<O>getField()Override.MethodSource<O>getMutator()Override.PropertySource<O>removeAccessor()Remove the accessor method.PropertySource<O>removeField()Remove the storing field.PropertySource<O>removeMutator()Remove the mutator method.PropertySource<O>setAccessible(boolean accessible)Set whether this property is accessible.PropertySource<O>setMutable(boolean mutable)Set whether this property is mutable.PropertySource<O>setType(Class<?> clazz)PropertySource<O>setType(String type)Set the type of thisPropertyto the given type.PropertySource<O>setType(JavaType<?> entity)-
Methods inherited from interface org.jboss.forge.roaster.model.AnnotationTarget
getAnnotation, getAnnotation, getAnnotations, hasAnnotation, hasAnnotation
-
Methods inherited from interface org.jboss.forge.roaster.Internal
getInternal
-
Methods inherited from interface org.jboss.forge.roaster.model.source.NamedSource
setName
-
Methods inherited from interface org.jboss.forge.roaster.model.Property
getType, hasField, isAccessible, isMutable
-
-
-
-
Method Detail
-
setType
PropertySource<O> setType(Class<?> clazz)
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
PropertySource<O> setType(String type)
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
PropertySource<O> setType(JavaType<?> entity)
Set the type of thisPropertyto the givenJavaTypetype. 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
PropertySource<O> setAccessible(boolean accessible)
Set whether this property is accessible.
-
setMutable
PropertySource<O> setMutable(boolean mutable)
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.
-
-