![JAR search and dependency download from the Maven repository](/logo.png)
templates.java.UnexpectedException.vsl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of andromda-java-cartridge Show documentation
Show all versions of andromda-java-cartridge Show documentation
Produces generic Java code, such as: value objects, enumerations, exceptions, interfaces, etc.
The newest version!
#if ($umlUtils.shouldOutput($class))
## IMPORTANT!!! We can remove this when we upgrade to AndroMDA 3.4
// license-header java merge-point
//
// Attention: Generated code! Do not modify by hand!
// Generated by: UnexpectedException.vsl in andromda-java-cartridge.
//
#if ($stringUtils.isNotBlank($class.packageName))
package $class.packageName;
#end
#set ($webFault=$class.hasStereotype("WebFault"))
#if ($webFault)
## Assume the only Exception AssociationEnd class is the faultBean
## FaultBean class is created by wsdl2java in CXF project and copied to common project
#set ($faultDetails=$class.packageName + "." + $class.name.replace("Exception", "Fault"))
#set ($faultClass=$class.name.replace("Exception", "Fault"))
#end
#parse("templates/java/ExceptionUtilsImports.vm")
/**
$class.getDocumentation(" * ")
*/
#if ($XMLBindingAnnotations)
@XmlRootElement(name="#if ($webFault)$faultClass#else$class.name#end")
// Annotate get/set fields with @XmlTransient, not the private fields.
@XmlAccessorType(XmlAccessType.FIELD)
#if ($webFault)
@XmlType(name="$stringUtils.uncapitalize($faultClass)")
@javax.xml.ws.WebFault( name="$faultClass", targetNamespace="http://$javaUtils.reversePackage($class.packageName)#if($addNamespaceBackslash)/#end")
#else
@XmlType(name="$stringUtils.uncapitalize($class.name)")
#end
#end
public#if($class.abstract) abstract#end class ${class.name}
#if($class.generalization)
extends ${class.generalization.fullyQualifiedName}
#else
extends RuntimeException
#end
#if (!$class.interfaceAbstractions.empty)
implements $class.implementedInterfaceList
#end
{
#if ($serializable)
/** The serial version UID of this class. Throwable implements Serializable so declaration not needed. */
private static final long serialVersionUID = ${class.serialVersionUID}L;
#end
#if ($webFault)
/** The Class with attributes populated with Exception Details, modeled as ValueObject, to fully describe the fault.
Exception throwable and message are stored in the Exception class, identifying details such as name and id are in FaultDetails */
private $faultDetails details;
#end
/**
* The default constructor.
*/
public ${class.name}()
{
// Avoid compiler warning from uncommented empty method
}
/**
* Constructs a new instance of ${class.name}
*
* @param throwable the parent Throwable
*/
public ${class.name}(Throwable throwable)
{
super(findRootCause(throwable));
}
/**
* Constructs a new instance of ${class.name}
*
* @param message the throwable message.
*/
public ${class.name}(String message)
{
super(message);
}
/**
* Constructs a new instance of ${class.name}
*
* @param message the throwable message.
* @param throwable the parent of this Throwable.
*/
public ${class.name}(String message, Throwable throwable)
{
super(message, findRootCause(throwable));
}
private Object[] messageArguments;
/**
* Gets the message arguments that can be used by message resources (in
* something like the presentation tier)
*
* @return messageArguments
*/
public Object[] getMessageArguments()
{
return this.messageArguments;
}
/**
* Sets the message arguments that can be used by message resources (in
* something like the presentation tier)
*
* @param arguments
*/
public void setMessageArguments(Object[] arguments)
{
this.messageArguments = arguments;
}
#parse("templates/java/ExceptionUtils.vm")
}
#end
© 2015 - 2025 Weber Informatics LLC | Privacy Policy