de.smartics.properties.spi.core.metadata
Class PropertyCommentProxy

Package class diagram package PropertyCommentProxy
java.lang.Object
  extended by de.smartics.properties.spi.core.metadata.PropertyCommentProxy
All Implemented Interfaces:
PropertyCommentProvider, Serializable

@NotThreadSafe
public final class PropertyCommentProxy
     
     
extends Object
implements PropertyCommentProvider

Proxy to load property comments on demand.

See Also:
Serialized Form

Constructor Summary
PropertyCommentProxy(PropertiesContext context)
          Default constructor.
 
Method Summary
 PropertyComment getComment(PropertyDescriptor propertyDescriptor, Locale locale)
          Returns the comment for the given property descriptor.
 String toString()
          Returns the string representation of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropertyCommentProxy

public PropertyCommentProxy(PropertiesContext context)
Default constructor. If the context is null, the proxy may only server empty property comment instances.

Parameters:
context - the properties context to fetch information from the META-INF folder.
Method Detail

getComment

public PropertyComment getComment(PropertyDescriptor propertyDescriptor,
                                  Locale locale)
Returns the comment for the given property descriptor.

Specified by:
getComment in interface PropertyCommentProvider
Implementation Notes:
Due to the very close relationship between the proxy and the property descriptor, the proxy cannot get access to its descriptor on creation time. The reason for the requirement that each invocation provides the same property descriptor is caching: the comments are cached with the locale as key. The property descriptor is not taken into account. This is okay since this implementation is private and only used internally by the PropertyMetaData class.
Parameters:
propertyDescriptor - the descriptor for which the comment is requested. It is required that this is the same for each invocation.
locale - the locale to select the language the comment is written in.
Returns:
the property comment for the given descriptor.

toString

public String toString()
Returns the string representation of the object.

Overrides:
toString in class Object
Returns:
the string representation of the object.


Copyright © 2012-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.