public class InvalidHolidayException extends OperationFailureException
public holiday
or a holiday is invalid.
See the Field Summary section for more information about the available reasons.
Depending on your business requirements, design and develop the relevant error handling functions in your client application.
The XML APIs specify the following XSD fragment:
XSD Fragment
<xs:element name="invalidHolidayFault">
<xs:complexType>
<xs:attribute name="error" type="InvalidHolidayFaultErrorType"/>
<xs:attribute name="message" type="xs:string"/>
</xs:complexType>
</xs:element><xs:simpleType name="InvalidHolidayFaultErrorType">
<xs:restriction base="xs:string">
<xs:enumeration value="nullHolidayCode"/>
<xs:enumeration value="invalidHolidayConfiguration"/>
<xs:enumeration value="invalidHolidayGroupDescription"/>
<xs:enumeration value="duplicatedHolidayCode"/>
<xs:enumeration value="duplicatedHolidayGroup"/>
</xs:restriction>
</xs:simpleType>
| Modifier and Type | Field and Description |
|---|---|
static int |
DUPLICATED_HOLIDAY_CODE
2: Reason used when a
HolidayModel code appears twice or more
in a PublicHolidaysModel object. |
static int |
DUPLICATED_HOLIDAY_GROUP
3: Reason used when a holiday group code appears twice or more
in a
PublicHolidaysModel object. |
static int |
INVALID_HOLIDAY_CONFIGURATION
1: Reason used when a
HolidayModel is not properly configured. |
static int |
INVALID_HOLIDAY_GROUP_DESCRIPTION
4: Reason used when a holiday group description is not properly configured.
|
static int |
NULL_HOLIDAY_CODE
0: Reason used when a
HolidayModel has no code. |
| Constructor and Description |
|---|
InvalidHolidayException()
Constructs an empty exception.
|
InvalidHolidayException(int error,
java.lang.String message)
Constructs an exception with an error code and a message.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCharacterData(java.lang.String cData)
Adds character data to the content element.
|
void |
addChild(java.lang.String tagName,
XMLMarshallable child)
Adds a child to the object, the
child representing
the marshallable object which must be added to the element. |
int |
getError()
Returns the reason why the holiday is
invalid.
|
java.lang.String |
getMessage()
Returns the comprehensive message explaining why
the holiday is invalid.
|
void |
marshal(XMLOutputter output)
Gives an XML representation of this object, including its children.
|
void |
setAttributes(XMLAttributes atts)
Sets the attributes of the XML representation of the element being
processed.
|
getOperandReferencepublic static final int NULL_HOLIDAY_CODE
HolidayModel has no code.public static final int INVALID_HOLIDAY_CONFIGURATION
HolidayModel is not properly configured.public static final int DUPLICATED_HOLIDAY_CODE
HolidayModel code appears twice or more
in a PublicHolidaysModel object.public static final int DUPLICATED_HOLIDAY_GROUP
PublicHolidaysModel object.public static final int INVALID_HOLIDAY_GROUP_DESCRIPTION
public InvalidHolidayException()
public InvalidHolidayException(int error,
java.lang.String message)
message - The messageerror - The errorpublic int getError()
NULL_HOLIDAY_CODE,
INVALID_HOLIDAY_CONFIGURATION,
DUPLICATED_HOLIDAY_CODE,
DUPLICATED_HOLIDAY_GROUP,
INVALID_HOLIDAY_GROUP_DESCRIPTIONpublic java.lang.String getMessage()
getMessage in class java.lang.Throwablepublic void setAttributes(XMLAttributes atts)
XMLMarshallableatts - The XML attributes of the current elementpublic void addCharacterData(java.lang.String cData)
XMLMarshallablecData - The character data to be addedpublic void addChild(java.lang.String tagName,
XMLMarshallable child)
XMLMarshallablechild representing
the marshallable object which must be added to the element.tagName - The name of tag for the childchild - The child to be addedpublic void marshal(XMLOutputter output)
XMLMarshallableoutput - The XML output to marshal the object into