com.vaadin.data.util.

Class TextFileProperty

    • Constructor Detail

      • TextFileProperty

        public TextFileProperty(File file)

        Wrap given file with property interface. Setting the file to null works, but getValue() will return null.

        Parameters:

        file - File to be wrapped.

      • TextFileProperty

        public TextFileProperty(File file,
                                Charset charset)

        Wrap the given file with the property interface and specify character set. Setting the file to null works, but getValue() will return null.

        Parameters:

        file - File to be wrapped.

        charset - Charset to be used for reading and writing the file.

    • Method Detail

      • getType

        public Class<String> getType()

        Description copied from interface: Property

        Returns the type of the Property. The methods getValue and setValue must be compatible with this type: one must be able to safely cast the value returned from getValue to the given type and pass any variable assignable to this type as an argument to setValue.

        Returns:

        type of the Property

      • getValue

        public String getValue()

        Description copied from interface: Property

        Gets the value stored in the Property. The returned object is compatible with the class returned by getType().

        Returns:

        the value stored in the Property

      • isReadOnly

        public boolean isReadOnly()

        Description copied from class: AbstractProperty

        Tests if the Property is in read-only mode. In read-only mode calls to the method setValue will throw ReadOnlyException and will not modify the value of the Property. Override for additional restrictions on what is considered a read-only property.

        Specified by:

        isReadOnly in interface Property<String>

        Overrides:

        isReadOnly in class AbstractProperty<String>

        Returns:

        true if the Property is in read-only mode, false if it's not

      • setValue

        public void setValue(String newValue)
                      throws Property.ReadOnlyException

        Description copied from interface: Property

        Sets the value of the Property.

        Implementing this functionality is optional. If the functionality is missing, one should declare the Property to be in read-only mode and throw Property.ReadOnlyException in this function.

        Note : Since Vaadin 7.0, setting the value of a non-String property as a String is no longer supported.

        Parameters:

        newValue - New value of the Property. This should be assignable to the type returned by getType

        Throws:

        Property.ReadOnlyException - if the object is in read-only mode