JavaScript is disabled on your browser.
Package: groovy.lang

[Java] Class MetaProperty

  • All Implemented Interfaces and Traits:
    MetaMember

    public abstract class MetaProperty
    extends Object
    implements MetaMember 

    Represents a property on a bean which may have a getter and/or a setter

    • Field Detail

      • public static final String PROPERTY_SET_PREFIX

    • Constructor Detail

      • public MetaProperty(String name, Class type)

        Constructor that sets the property name and type (class)

    • Method Detail

      • public static String getGetterName(String propertyName, Class type)

        Gets the name for the getter for this property

        Returns:
        The name of the property. The name is "get" + the capitalized propertyName or, in the case of boolean values, "is" + the capitalized propertyName

      • @Override
        public String getName()

        Returns the name of the property.

        Returns:
        the name of the property

      • public abstract Object getProperty(Object object)

        throws:
        RuntimeException if the property could not be evaluated
        Returns:
        the property of the given object

      • public static String getSetterName(String propertyName)

        Gets the setter for the getter for this property.

        Returns:
        The name of the property. The name is "set"+ the capitalized propertyName.

      • public Class getType()

        Returns the ntypeame of the property.

        Returns:
        the type of the property

      • public abstract void setProperty(Object object, Object newValue)

        Sets the property on the given object to the new value.

        throws:
        RuntimeException if the property could not be set
        Parameters:
        object - on which to set the property
        newValue - the new value of the property

Copyright © 2003-2025 The Apache Software Foundation. All rights reserved.

AltStyle によって変換されたページ (->オリジナル) /