All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.vraptor.url.DefaultRequestInfo Maven / Gradle / Ivy

Go to download

mvc and ioc controller based on java 5 annotations and conventions

There is a newer version: 2.6.2
Show newest version
package org.vraptor.url;

/**
 * Simple implementation of a request info.
 * 
 * @author Paulo Silveira
 * @since 2.2.3
 */
public class DefaultRequestInfo implements RequestInfo {

	private final String componentName;

	private final String logicName;

	private final String viewType;

	/**
	 * @param componentName
	 *            the name of the Component to be used
	 * @param logicName
	 *            the logic name form the component that will be invoked
	 */
	public DefaultRequestInfo(String componentName, String logicName) {
		this(componentName, logicName, null);
	}

	/**
	 * @param componentName
	 *            the name of the Component to be used
	 * @param logicName
	 *            the logic name form the component that will be invoked
	 * @param viewType
	 *            "json", "xml" or null for normal treatment
	 */
	public DefaultRequestInfo(String componentName, String logicName, String viewType) {
		this.componentName = componentName;
		this.logicName = logicName;
		this.viewType = viewType;
	}

	/* (non-Javadoc)
	 * @see org.vraptor.url.RequestInfo#getComponentName()
	 */
	public String getComponentName() {
		return componentName;
	}

	/* (non-Javadoc)
	 * @see org.vraptor.url.RequestInfo#getLogicName()
	 */
	public String getLogicName() {
		return logicName;
	}

	/* (non-Javadoc)
	 * @see org.vraptor.url.RequestInfo#getViewType()
	 */
	public String getViewType() {
		return viewType;
	}

	/* (non-Javadoc)
	 * @see org.vraptor.url.RequestInfo#isDefaultView()
	 */
	public boolean isDefaultView() {
		return viewType == null;
	}
	
	@Override
	public String toString() {
		return String.format("[RequestInfo: %s, %s, %s]", componentName, logicName, viewType);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy