Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /* 
  * Copyright (C) 2012 FoxLabs
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  * 
  * http://www.apache.org/licenses/LICENSE-2.0
  * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.foxlabs.validation.metadata;
Defines descriptor that holds necessary metadata about property.

Parameters:
<T> The type of entity
<V> The type of property
Author(s):
Fox Mulder
public interface PropertyMetaData<T, V> extends ElementMetaData<T, V> {
    
    
Returns converter to be used for property value conversion into and from string representation.

Returns:
Converter to be used for property value conversion into and from string representation.
    Converter<V> getConverter();
    
    
Determines if this property requires value.

Returns:
true if this property requires value; false otherwise.
    boolean isRequired();
    
    
Determines if this property is readable.

Returns:
true if this property is readable; false otherwise.
    boolean isReadable();
    
    
Determines if this property is writeable.

Returns:
true if this property is writeable; false otherwise.
    boolean isWriteable();
    
    
Returns value of this property for the specified entity.

Parameters:
entity Entity whose property value should be returned.
Returns:
Value of this property for the specified entity.
Throws:
java.lang.IllegalArgumentException if the specified entity is null.
java.lang.UnsupportedOperationException if this property is not readable.
    V getValue(T entity);
    
    
Assigns value of this property for the specified entity.

Parameters:
entity Entity whose property value should be assigned.
value New property value.
Throws:
java.lang.IllegalArgumentException if the specified entity is null.
java.lang.UnsupportedOperationException if this property is not writeable.
    void setValue(T entityObject value);
    
New to GrepCode? Check out our FAQ X