Class SetPropertyClass
java.lang.Object
org.apache.tomcat.util.xreflection.SetPropertyClass
- All Implemented Interfaces:
Comparable<SetPropertyClass>
Represents a class in the reflection-based property setter/getter code
generation system. Tracks properties, parent/child class relationships,
and generates optimized reflection-free property access code.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddProperty(org.apache.tomcat.util.xreflection.ReflectionProperty property) Add a property to this class.intbooleanGenerate a complete getProperty method for this class with switch-case statements for each known property.generateGetPropertyMethod(org.apache.tomcat.util.xreflection.ReflectionProperty property) Generate a Java code snippet to get the given property value.Generate a switch case statement that invokes the getProperty method for this class.Generate a switch case statement that invokes the setProperty method for this class.Generate a method invocation string for the getProperty method of this class, suitable for use from a parent class.Generate a method invocation string for the setProperty method of this class, suitable for use from a parent class.Generate a complete setProperty method for this class with switch-case statements for each known property.generateSetPropertyMethod(org.apache.tomcat.util.xreflection.ReflectionProperty property) Generate a Java code snippet to set the given property value.Generate the method header for the getProperty method for this class.Generate the method header for the setProperty method for this class.Returns the set of child classes registered under this class.Class<?> getClazz()Returns theClassrepresented by this instance.Returns the generic getProperty method if one exists.Returns the generic setProperty method if one exists.Returns the parent class.Set<org.apache.tomcat.util.xreflection.ReflectionProperty> Returns the set of reflection properties for this class.inthashCode()toString()
-
Method Details
-
getChildren
Returns the set of child classes registered under this class.- Returns:
- the child classes
-
getProperties
Returns the set of reflection properties for this class.- Returns:
- the reflection properties
-
getGenericSetPropertyMethod
Returns the generic setProperty method if one exists.- Returns:
- the generic setProperty method, or
null
-
getGenericGetPropertyMethod
Returns the generic getProperty method if one exists.- Returns:
- the generic getProperty method, or
null
-
equals
-
hashCode
-
getParent
Returns the parent class.- Returns:
- the parent class, or
nullif this is the root class
-
getClazz
-
toString
-
addProperty
public void addProperty(org.apache.tomcat.util.xreflection.ReflectionProperty property) Add a property to this class.- Parameters:
property- the property to add
-
generateSetPropertyMethod
public String generateSetPropertyMethod(org.apache.tomcat.util.xreflection.ReflectionProperty property) Generate a Java code snippet to set the given property value.- Parameters:
property- the property to generate code for- Returns:
- the generated code snippet, or
nullif no setter is available
-
generateGetPropertyMethod
public String generateGetPropertyMethod(org.apache.tomcat.util.xreflection.ReflectionProperty property) Generate a Java code snippet to get the given property value.- Parameters:
property- the property to generate code for- Returns:
- the generated code snippet, or
nullif no getter is available
-
generateSetPropertyForMethod
Generate a complete setProperty method for this class with switch-case statements for each known property.- Returns:
- the generated Java source code
-
generateInvocationSetForPropertyCaseStatement
Generate a switch case statement that invokes the setProperty method for this class.- Parameters:
level- the indentation level- Returns:
- the generated Java source code
-
generateParentSetPropertyForMethodInvocation
Generate a method invocation string for the setProperty method of this class, suitable for use from a parent class.- Returns:
- the generated method invocation string
-
generatesSetPropertyForMethodHeader
Generate the method header for the setProperty method for this class.- Returns:
- the generated method header string
-
generateInvocationGetForPropertyCaseStatement
Generate a switch case statement that invokes the getProperty method for this class.- Parameters:
level- the indentation level- Returns:
- the generated Java source code
-
generateParentGetPropertyForMethodInvocation
Generate a method invocation string for the getProperty method of this class, suitable for use from a parent class.- Returns:
- the generated method invocation string
-
generatesGetPropertyForMethodHeader
Generate the method header for the getProperty method for this class.- Returns:
- the generated method header string
-
generateGetPropertyForMethod
Generate a complete getProperty method for this class with switch-case statements for each known property.- Returns:
- the generated Java source code
-
compareTo
- Specified by:
compareToin interfaceComparable<SetPropertyClass>
-