org.thymeleaf.messageresolver
Class AbstractMessageResolver

Object
  extended by org.thymeleaf.messageresolver.AbstractMessageResolver
All Implemented Interfaces:
IMessageResolver
Direct Known Subclasses:
StandardMessageResolver

public abstract class AbstractMessageResolver
extends Object
implements IMessageResolver

Base abstract implementation for message resolvers implementing the IMessageResolver interface.

Since:
1.0
Author:
Daniel Fernández

Constructor Summary
protected AbstractMessageResolver()
           
 
Method Summary
protected  void checkInitialized()
           Check the message resolver is initialized, and throw an exception if it is not.
protected  void checkNotInitialized()
           Check the message resolver is not initialized, and throw an exception if it is.
 String getName()
           Returns the name of the message resolver.
 Integer getOrder()
           Return the order in which this message resolver will be executed in the chain when several message resolvers are set for the same Template Engine.
 void initialize()
           Initialize the Message Resolver.
protected  void initializeSpecific()
           Initialize specific aspects of a subclass.
protected  boolean isInitialized()
           
 void setName(String name)
           Sets a name for this message resolver.
 void setOrder(Integer order)
           Sets a new order for the message resolver.
protected  String unsafeGetName()
           Unsynchronized method meant only for use by subclasses.
protected  Integer unsafeGetOrder()
           Unsynchronized method meant only for use by subclasses.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.thymeleaf.messageresolver.IMessageResolver
resolveMessage
 

Constructor Detail

AbstractMessageResolver

protected AbstractMessageResolver()
Method Detail

isInitialized

protected final boolean isInitialized()

initialize

public final void initialize()
Description copied from interface: IMessageResolver

Initialize the Message Resolver. Once initialized, none of its configuration parameters should be allowed to change.

This method is called by TemplateEngine. Do not use directly in your code.

Specified by:
initialize in interface IMessageResolver

initializeSpecific

protected void initializeSpecific()

Initialize specific aspects of a subclass. This method is called during initialization of TemplateResolver (initialize()) and is meant for being overridden by subclasses.


checkNotInitialized

protected final void checkNotInitialized()

Check the message resolver is not initialized, and throw an exception if it is.

Calling this method allows to protect calls to methods that change the configuration, ensuring the message resolver has not been initialized yet.


checkInitialized

protected final void checkInitialized()

Check the message resolver is initialized, and throw an exception if it is not.

Calling this method allows to protect calls to methods that need the message resolver to be already initialized.


getName

public final String getName()
Description copied from interface: IMessageResolver

Returns the name of the message resolver.

Specified by:
getName in interface IMessageResolver
Returns:
the name of the message resolver

unsafeGetName

protected final String unsafeGetName()

Unsynchronized method meant only for use by subclasses.

Returns:
the name

setName

public void setName(String name)

Sets a name for this message resolver.

Parameters:
name - the new name

getOrder

public final Integer getOrder()
Description copied from interface: IMessageResolver

Return the order in which this message resolver will be executed in the chain when several message resolvers are set for the same Template Engine.

Specified by:
getOrder in interface IMessageResolver
Returns:
the order of this resolver in the chain.

unsafeGetOrder

protected final Integer unsafeGetOrder()

Unsynchronized method meant only for use by subclasses.

Returns:
the order

setOrder

public void setOrder(Integer order)

Sets a new order for the message resolver.

Parameters:
order - the new order


Copyright © 2012 The THYMELEAF team. All Rights Reserved.