net.craftforge.essential.controller
Class Configuration

java.lang.Object
  extended by net.craftforge.commons.configuration.PropertiesHolder
      extended by net.craftforge.essential.controller.Configuration

public class Configuration
extends PropertiesHolder

A controller configuration.

Since:
03.03.2011
Author:
Christian Bick

Field Summary
static String DEFAULT_CONFIG_FILE
          The default configuration file
static Class<?> DEFAULT_CONSUMER
           
static Class<?> DEFAULT_PHASE_FLOW
           
static Class<?> DEFAULT_PRODUCER
           
static String PROPERTY_AUTHENTICATION_HANDLER
           
static String PROPERTY_DEFAULT_CONSUMER
           
static String PROPERTY_DEFAULT_PRODUCER
           
static String PROPERTY_JSON_DESERIALIZATION
           
static String PROPERTY_JSON_SERIALIZATION
           
static String PROPERTY_PHASE_FLOW
           
static String PROPERTY_XML_DESERIALIZATION
           
static String PROPERTY_XML_SERIALIZATION
           
 
Constructor Summary
Configuration()
          Initializes a configuration using the default configuration file.
Configuration(String configFile)
          Initializes a configuration using the given configuration file.
 
Method Summary
 Class<?> getAuthenticationHandler()
          Gets the class of the authentication handler.
 Class<?> getDefaultConsumer()
          Gets the class of the default consumer.
 Class<?> getDefaultProducer()
          Gets the class of the default producer.
 Map<String,String> getJsonDeserializationProperties()
          Gets the JSON deserialization properties.
 Map<String,String> getJsonSerializationProperties()
          Gets the JSON serialization properties.
 Class<?> getPhaseFlow()
          Gets the class of the phase flow defining the controller's phase execution logic.
 Map<String,String> getXmlDeserializationProperties()
          Gets the XML deserialization properties.
 Map<String,String> getXmlSerializationProperties()
          Gets the XML serialization properties.
 void setAuthenticationHandler(Class<?> authenticationHandler)
          Sets the class of the authentication handler.
 void setDefaultConsumer(Class<?> defaultConsumer)
          Sets the class of the default consumer.
 void setDefaultProducer(Class<?> defaultProducer)
          Sets the class of the default producer.
 void setJsonDeserializationProperties(Map<String,String> jsonDeserializationProperties)
          Sets the JSON deserialization properties.
 void setJsonSerializationProperties(Map<String,String> jsonSerializationProperties)
          Sets the JSON serialization properties.
 void setPhaseFlow(Class<?> phaseFlow)
          Sets the class of the phase flow defining the controller's phase execution logic.
 void setXmlDeserializationProperties(Map<String,String> xmlDeserializationProperties)
          Sets the XML deserialization properties.
 void setXmlSerializationProperties(Map<String,String> xmlSerializationProperties)
          Sets the XML serialization properties.
 
Methods inherited from class net.craftforge.commons.configuration.PropertiesHolder
createClass, createMap, getClass, getProperties, getProperty, removeClass, removeMaps, setProperties, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CONFIG_FILE

public static final String DEFAULT_CONFIG_FILE
The default configuration file

See Also:
Constant Field Values

PROPERTY_DEFAULT_CONSUMER

public static final String PROPERTY_DEFAULT_CONSUMER
See Also:
Constant Field Values

PROPERTY_DEFAULT_PRODUCER

public static final String PROPERTY_DEFAULT_PRODUCER
See Also:
Constant Field Values

PROPERTY_PHASE_FLOW

public static final String PROPERTY_PHASE_FLOW
See Also:
Constant Field Values

PROPERTY_AUTHENTICATION_HANDLER

public static final String PROPERTY_AUTHENTICATION_HANDLER
See Also:
Constant Field Values

PROPERTY_XML_DESERIALIZATION

public static final String PROPERTY_XML_DESERIALIZATION
See Also:
Constant Field Values

PROPERTY_XML_SERIALIZATION

public static final String PROPERTY_XML_SERIALIZATION
See Also:
Constant Field Values

PROPERTY_JSON_DESERIALIZATION

public static final String PROPERTY_JSON_DESERIALIZATION
See Also:
Constant Field Values

PROPERTY_JSON_SERIALIZATION

public static final String PROPERTY_JSON_SERIALIZATION
See Also:
Constant Field Values

DEFAULT_CONSUMER

public static final Class<?> DEFAULT_CONSUMER

DEFAULT_PRODUCER

public static final Class<?> DEFAULT_PRODUCER

DEFAULT_PHASE_FLOW

public static final Class<?> DEFAULT_PHASE_FLOW
Constructor Detail

Configuration

public Configuration()
Initializes a configuration using the default configuration file.


Configuration

public Configuration(String configFile)
Initializes a configuration using the given configuration file.

Parameters:
configFile - The configuration file
Method Detail

getDefaultConsumer

public Class<?> getDefaultConsumer()
Gets the class of the default consumer.

Returns:
The class of the default consumer

setDefaultConsumer

public void setDefaultConsumer(Class<?> defaultConsumer)

Sets the class of the default consumer. The default consumer is used if a resource method or its resource class is not annotated with the @Consumer annotation.

Default: net.craftforge.essential.supply.jaxb.JaxbConsumer

Parameters:
defaultConsumer - The class of the default consumer

getDefaultProducer

public Class<?> getDefaultProducer()
Gets the class of the default producer.

Returns:
The class of the default producer.

setDefaultProducer

public void setDefaultProducer(Class<?> defaultProducer)
Sets the class of the default producer. The default producer is used if a resource method or its resource class is not annotated with the @Producer annotation.

Default: net.craftforge.essential.supply.jaxb.JaxbProducer

Parameters:
defaultProducer - The class of the default producer.

getPhaseFlow

public Class<?> getPhaseFlow()
Gets the class of the phase flow defining the controller's phase execution logic.

Returns:
The class of the phase flow

setPhaseFlow

public void setPhaseFlow(Class<?> phaseFlow)
Sets the class of the phase flow defining the controller's phase execution logic.

Default: net.craftforge.essential.controller.phases.flow.StandardPhaseFlow

Parameters:
phaseFlow - The class of the phase flow

getAuthenticationHandler

public Class<?> getAuthenticationHandler()
Gets the class of the authentication handler.

Returns:
The class of the authentication handler

setAuthenticationHandler

public void setAuthenticationHandler(Class<?> authenticationHandler)
Sets the class of the authentication handler. If no authentication handler is specified, the authentication phase will be skipped.

Parameters:
authenticationHandler - The class of the authentication handler

getXmlDeserializationProperties

public Map<String,String> getXmlDeserializationProperties()
Gets the XML deserialization properties. Adding properties according to specifications can be used to fine-tune the XML deserialization process.

Returns:
The XML deserialization properties as Map

setXmlDeserializationProperties

public void setXmlDeserializationProperties(Map<String,String> xmlDeserializationProperties)
Sets the XML deserialization properties. Adding properties according to specifications can be used to fine-tune the XML deserialization process.

Parameters:
xmlDeserializationProperties - The XML deserialization properties as Map

getJsonDeserializationProperties

public Map<String,String> getJsonDeserializationProperties()
Gets the JSON deserialization properties. Adding properties according to specifications can be used to fine-tune the JSON deserialization process.

Returns:
The JSON deserialization properties as Map

setJsonDeserializationProperties

public void setJsonDeserializationProperties(Map<String,String> jsonDeserializationProperties)
Sets the JSON deserialization properties. Adding properties according to specifications can be used to fine-tune the JSON deserialization process.

Parameters:
jsonDeserializationProperties - The JSON deserialization properties as Map

getXmlSerializationProperties

public Map<String,String> getXmlSerializationProperties()
Gets the XML serialization properties. Adding properties according to specifications can be used to fine-tune the XML serialization process.

Returns:
The XML serialization properties as Map

setXmlSerializationProperties

public void setXmlSerializationProperties(Map<String,String> xmlSerializationProperties)
Sets the XML serialization properties. Adding properties according to specifications can be used to fine-tune the XML serialization process.

Parameters:
xmlSerializationProperties - The XML serialization properties as Map

getJsonSerializationProperties

public Map<String,String> getJsonSerializationProperties()
Gets the JSON serialization properties. Adding properties according to specifications can be used to fine-tune the JSON serialization process.

Returns:
The JSON serialization properties as Map

setJsonSerializationProperties

public void setJsonSerializationProperties(Map<String,String> jsonSerializationProperties)
Sets the JSON serialization properties. Adding properties according to specifications can be used to fine-tune the JSON serialization process.

Parameters:
jsonSerializationProperties - The JSON serialization properties as Map


Copyright © 2011. All Rights Reserved.