List of usage examples for java.lang Short Short
@Deprecated(since = "9") public Short(String s) throws NumberFormatException
From source file:net.sourceforge.msscodefactory.cfcore.v2_0.CFGenKbXMsgRqstHandler.CFGenKbXMsgRqstGenFormatterCreateHandler.java
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { try {//ww w .java2 s . co m // Common XML Attributes String attrId = null; String attrRevision = null; // GenItem Attributes String attrTenantId = null; String attrCartridgeId = null; String attrItemId = null; String attrRuleTypeId = null; String attrName = null; String attrToolSetId = null; String attrScopeDefId = null; String attrGenDefId = null; String attrGelExecutableId = null; // GenBind Attributes // GenFormatter Attributes // Attribute Extraction String attrLocalName; int numAttrs; int idxAttr; final String S_ProcName = "startElement"; final String S_LocalName = "LocalName"; assert qName.equals("RqstGenFormatterCreate"); CFGenKbXMsgRqstHandler xmsgRqstHandler = (CFGenKbXMsgRqstHandler) getParser(); if (xmsgRqstHandler == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "getParser()"); } ICFGenKbSchemaObj schemaObj = xmsgRqstHandler.getSchemaObj(); if (schemaObj == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "getParser().getSchemaObj()"); } // Instantiate an edit buffer for the parsed information ICFGenKbGenFormatterEditObj editBuff = (ICFGenKbGenFormatterEditObj) schemaObj.getGenFormatterTableObj() .newInstance().beginEdit(); CFGenKbGenFormatterBuff dataBuff = editBuff.getGenFormatterBuff(); // Extract Attributes numAttrs = attrs.getLength(); for (idxAttr = 0; idxAttr < numAttrs; idxAttr++) { attrLocalName = attrs.getLocalName(idxAttr); if (attrLocalName.equals("Id")) { if (attrId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("schemaLocation")) { // ignored } else if (attrLocalName.equals("Revision")) { if (attrRevision != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrRevision = attrs.getValue(idxAttr); } else if (attrLocalName.equals("TenantId")) { if (attrTenantId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrTenantId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("CartridgeId")) { if (attrCartridgeId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrCartridgeId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("ItemId")) { if (attrItemId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrItemId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("RuleTypeId")) { if (attrRuleTypeId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrRuleTypeId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("Name")) { if (attrName != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrName = attrs.getValue(idxAttr); } else if (attrLocalName.equals("ToolSetId")) { if (attrToolSetId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrToolSetId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("ScopeDefId")) { if (attrScopeDefId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrScopeDefId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("GenDefId")) { if (attrGenDefId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrGenDefId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("GelExecutableId")) { if (attrGelExecutableId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrGelExecutableId = attrs.getValue(idxAttr); } else { throw CFLib.getDefaultExceptionFactory().newUnrecognizedAttributeException(getClass(), S_ProcName, getParser().getLocationInfo(), attrLocalName); } } // Ensure that required attributes have values if ((attrTenantId == null) || (attrTenantId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "TenantId"); } if ((attrCartridgeId == null) || (attrCartridgeId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "CartridgeId"); } if ((attrItemId == null) || (attrItemId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "ItemId"); } if ((attrRuleTypeId == null) || (attrRuleTypeId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "RuleTypeId"); } if (attrName == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "Name"); } if ((attrToolSetId == null) || (attrToolSetId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "ToolSetId"); } if ((attrGenDefId == null) || (attrGenDefId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "GenDefId"); } // Save named attributes to context CFLibXmlCoreContext curContext = getParser().getCurContext(); // Convert string attributes to native Java types // and apply the converted attributes to the editBuff. long natTenantId = Long.parseLong(attrTenantId); dataBuff.setRequiredTenantId(natTenantId); long natCartridgeId = Long.parseLong(attrCartridgeId); dataBuff.setRequiredCartridgeId(natCartridgeId); short natRuleTypeId = Short.parseShort(attrRuleTypeId); dataBuff.setRequiredRuleTypeId(natRuleTypeId); String natName = attrName; dataBuff.setRequiredName(natName); short natToolSetId = Short.parseShort(attrToolSetId); dataBuff.setRequiredToolSetId(natToolSetId); Short natScopeDefId; if ((attrScopeDefId == null) || (attrScopeDefId.length() <= 0)) { natScopeDefId = null; } else { natScopeDefId = new Short(Short.parseShort(attrScopeDefId)); } dataBuff.setOptionalScopeDefId(natScopeDefId); short natGenDefId = Short.parseShort(attrGenDefId); dataBuff.setRequiredGenDefId(natGenDefId); Integer natGelExecutableId; if ((attrGelExecutableId == null) || (attrGelExecutableId.length() <= 0)) { natGelExecutableId = null; } else { natGelExecutableId = new Integer(Integer.parseInt(attrGelExecutableId)); } dataBuff.setOptionalGelExecutableId(natGelExecutableId); // Attempt the create editBuff.copyBuffToPKey(); // Allow for predefined ids ICFGenKbGenFormatterObj created = (ICFGenKbGenFormatterObj) editBuff.create(); editBuff.endEdit(); String response = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgGenFormatterMessageFormatter.formatGenFormatterRspnCreated("\n\t\t\t", created.getGenFormatterBuff()) + "\n" + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); ((CFGenKbXMsgRqstHandler) getParser()).appendResponse(response); } catch (RuntimeException e) { String response = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n" + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); CFGenKbXMsgRqstHandler xmsgRqstHandler = ((CFGenKbXMsgRqstHandler) getParser()); xmsgRqstHandler.resetResponse(); xmsgRqstHandler.appendResponse(response); xmsgRqstHandler.setCaughtException(true); } catch (Error e) { String response = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n" + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); CFGenKbXMsgRqstHandler xmsgRqstHandler = ((CFGenKbXMsgRqstHandler) getParser()); xmsgRqstHandler.resetResponse(); xmsgRqstHandler.appendResponse(response); xmsgRqstHandler.setCaughtException(true); } }
From source file:net.sourceforge.msscodefactory.cfcore.v2_0.CFGenKbXMsgRqstHandler.CFGenKbXMsgRqstBoolFormatterCreateHandler.java
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { try {// ww w. j av a 2 s . c o m // Common XML Attributes String attrId = null; String attrRevision = null; // GenItem Attributes String attrTenantId = null; String attrCartridgeId = null; String attrItemId = null; String attrRuleTypeId = null; String attrName = null; String attrToolSetId = null; String attrScopeDefId = null; String attrGenDefId = null; String attrGelExecutableId = null; // GenBind Attributes // GenFormatter Attributes // BoolFormatter Attributes // Attribute Extraction String attrLocalName; int numAttrs; int idxAttr; final String S_ProcName = "startElement"; final String S_LocalName = "LocalName"; assert qName.equals("RqstBoolFormatterCreate"); CFGenKbXMsgRqstHandler xmsgRqstHandler = (CFGenKbXMsgRqstHandler) getParser(); if (xmsgRqstHandler == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "getParser()"); } ICFGenKbSchemaObj schemaObj = xmsgRqstHandler.getSchemaObj(); if (schemaObj == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "getParser().getSchemaObj()"); } // Instantiate an edit buffer for the parsed information ICFGenKbBoolFormatterEditObj editBuff = (ICFGenKbBoolFormatterEditObj) schemaObj .getBoolFormatterTableObj().newInstance().beginEdit(); CFGenKbBoolFormatterBuff dataBuff = editBuff.getBoolFormatterBuff(); // Extract Attributes numAttrs = attrs.getLength(); for (idxAttr = 0; idxAttr < numAttrs; idxAttr++) { attrLocalName = attrs.getLocalName(idxAttr); if (attrLocalName.equals("Id")) { if (attrId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("schemaLocation")) { // ignored } else if (attrLocalName.equals("Revision")) { if (attrRevision != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrRevision = attrs.getValue(idxAttr); } else if (attrLocalName.equals("TenantId")) { if (attrTenantId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrTenantId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("CartridgeId")) { if (attrCartridgeId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrCartridgeId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("ItemId")) { if (attrItemId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrItemId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("RuleTypeId")) { if (attrRuleTypeId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrRuleTypeId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("Name")) { if (attrName != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrName = attrs.getValue(idxAttr); } else if (attrLocalName.equals("ToolSetId")) { if (attrToolSetId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrToolSetId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("ScopeDefId")) { if (attrScopeDefId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrScopeDefId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("GenDefId")) { if (attrGenDefId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrGenDefId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("GelExecutableId")) { if (attrGelExecutableId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrGelExecutableId = attrs.getValue(idxAttr); } else { throw CFLib.getDefaultExceptionFactory().newUnrecognizedAttributeException(getClass(), S_ProcName, getParser().getLocationInfo(), attrLocalName); } } // Ensure that required attributes have values if ((attrTenantId == null) || (attrTenantId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "TenantId"); } if ((attrCartridgeId == null) || (attrCartridgeId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "CartridgeId"); } if ((attrItemId == null) || (attrItemId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "ItemId"); } if ((attrRuleTypeId == null) || (attrRuleTypeId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "RuleTypeId"); } if (attrName == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "Name"); } if ((attrToolSetId == null) || (attrToolSetId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "ToolSetId"); } if ((attrGenDefId == null) || (attrGenDefId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "GenDefId"); } // Save named attributes to context CFLibXmlCoreContext curContext = getParser().getCurContext(); // Convert string attributes to native Java types // and apply the converted attributes to the editBuff. long natTenantId = Long.parseLong(attrTenantId); dataBuff.setRequiredTenantId(natTenantId); long natCartridgeId = Long.parseLong(attrCartridgeId); dataBuff.setRequiredCartridgeId(natCartridgeId); short natRuleTypeId = Short.parseShort(attrRuleTypeId); dataBuff.setRequiredRuleTypeId(natRuleTypeId); String natName = attrName; dataBuff.setRequiredName(natName); short natToolSetId = Short.parseShort(attrToolSetId); dataBuff.setRequiredToolSetId(natToolSetId); Short natScopeDefId; if ((attrScopeDefId == null) || (attrScopeDefId.length() <= 0)) { natScopeDefId = null; } else { natScopeDefId = new Short(Short.parseShort(attrScopeDefId)); } dataBuff.setOptionalScopeDefId(natScopeDefId); short natGenDefId = Short.parseShort(attrGenDefId); dataBuff.setRequiredGenDefId(natGenDefId); Integer natGelExecutableId; if ((attrGelExecutableId == null) || (attrGelExecutableId.length() <= 0)) { natGelExecutableId = null; } else { natGelExecutableId = new Integer(Integer.parseInt(attrGelExecutableId)); } dataBuff.setOptionalGelExecutableId(natGelExecutableId); // Attempt the create editBuff.copyBuffToPKey(); // Allow for predefined ids ICFGenKbBoolFormatterObj created = (ICFGenKbBoolFormatterObj) editBuff.create(); editBuff.endEdit(); String response = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgBoolFormatterMessageFormatter.formatBoolFormatterRspnCreated("\n\t\t\t", created.getBoolFormatterBuff()) + "\n" + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); ((CFGenKbXMsgRqstHandler) getParser()).appendResponse(response); } catch (RuntimeException e) { String response = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n" + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); CFGenKbXMsgRqstHandler xmsgRqstHandler = ((CFGenKbXMsgRqstHandler) getParser()); xmsgRqstHandler.resetResponse(); xmsgRqstHandler.appendResponse(response); xmsgRqstHandler.setCaughtException(true); } catch (Error e) { String response = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n" + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); CFGenKbXMsgRqstHandler xmsgRqstHandler = ((CFGenKbXMsgRqstHandler) getParser()); xmsgRqstHandler.resetResponse(); xmsgRqstHandler.appendResponse(response); xmsgRqstHandler.setCaughtException(true); } }
From source file:net.sourceforge.msscodefactory.cfcore.v2_0.CFGenKbXMsgRqstHandler.CFGenKbXMsgRqstDateFormatterCreateHandler.java
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { try {/*from ww w. j av a2s . c o m*/ // Common XML Attributes String attrId = null; String attrRevision = null; // GenItem Attributes String attrTenantId = null; String attrCartridgeId = null; String attrItemId = null; String attrRuleTypeId = null; String attrName = null; String attrToolSetId = null; String attrScopeDefId = null; String attrGenDefId = null; String attrGelExecutableId = null; // GenBind Attributes // GenFormatter Attributes // DateFormatter Attributes // Attribute Extraction String attrLocalName; int numAttrs; int idxAttr; final String S_ProcName = "startElement"; final String S_LocalName = "LocalName"; assert qName.equals("RqstDateFormatterCreate"); CFGenKbXMsgRqstHandler xmsgRqstHandler = (CFGenKbXMsgRqstHandler) getParser(); if (xmsgRqstHandler == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "getParser()"); } ICFGenKbSchemaObj schemaObj = xmsgRqstHandler.getSchemaObj(); if (schemaObj == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "getParser().getSchemaObj()"); } // Instantiate an edit buffer for the parsed information ICFGenKbDateFormatterEditObj editBuff = (ICFGenKbDateFormatterEditObj) schemaObj .getDateFormatterTableObj().newInstance().beginEdit(); CFGenKbDateFormatterBuff dataBuff = editBuff.getDateFormatterBuff(); // Extract Attributes numAttrs = attrs.getLength(); for (idxAttr = 0; idxAttr < numAttrs; idxAttr++) { attrLocalName = attrs.getLocalName(idxAttr); if (attrLocalName.equals("Id")) { if (attrId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("schemaLocation")) { // ignored } else if (attrLocalName.equals("Revision")) { if (attrRevision != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrRevision = attrs.getValue(idxAttr); } else if (attrLocalName.equals("TenantId")) { if (attrTenantId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrTenantId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("CartridgeId")) { if (attrCartridgeId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrCartridgeId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("ItemId")) { if (attrItemId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrItemId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("RuleTypeId")) { if (attrRuleTypeId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrRuleTypeId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("Name")) { if (attrName != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrName = attrs.getValue(idxAttr); } else if (attrLocalName.equals("ToolSetId")) { if (attrToolSetId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrToolSetId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("ScopeDefId")) { if (attrScopeDefId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrScopeDefId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("GenDefId")) { if (attrGenDefId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrGenDefId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("GelExecutableId")) { if (attrGelExecutableId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrGelExecutableId = attrs.getValue(idxAttr); } else { throw CFLib.getDefaultExceptionFactory().newUnrecognizedAttributeException(getClass(), S_ProcName, getParser().getLocationInfo(), attrLocalName); } } // Ensure that required attributes have values if ((attrTenantId == null) || (attrTenantId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "TenantId"); } if ((attrCartridgeId == null) || (attrCartridgeId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "CartridgeId"); } if ((attrItemId == null) || (attrItemId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "ItemId"); } if ((attrRuleTypeId == null) || (attrRuleTypeId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "RuleTypeId"); } if (attrName == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "Name"); } if ((attrToolSetId == null) || (attrToolSetId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "ToolSetId"); } if ((attrGenDefId == null) || (attrGenDefId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "GenDefId"); } // Save named attributes to context CFLibXmlCoreContext curContext = getParser().getCurContext(); // Convert string attributes to native Java types // and apply the converted attributes to the editBuff. long natTenantId = Long.parseLong(attrTenantId); dataBuff.setRequiredTenantId(natTenantId); long natCartridgeId = Long.parseLong(attrCartridgeId); dataBuff.setRequiredCartridgeId(natCartridgeId); short natRuleTypeId = Short.parseShort(attrRuleTypeId); dataBuff.setRequiredRuleTypeId(natRuleTypeId); String natName = attrName; dataBuff.setRequiredName(natName); short natToolSetId = Short.parseShort(attrToolSetId); dataBuff.setRequiredToolSetId(natToolSetId); Short natScopeDefId; if ((attrScopeDefId == null) || (attrScopeDefId.length() <= 0)) { natScopeDefId = null; } else { natScopeDefId = new Short(Short.parseShort(attrScopeDefId)); } dataBuff.setOptionalScopeDefId(natScopeDefId); short natGenDefId = Short.parseShort(attrGenDefId); dataBuff.setRequiredGenDefId(natGenDefId); Integer natGelExecutableId; if ((attrGelExecutableId == null) || (attrGelExecutableId.length() <= 0)) { natGelExecutableId = null; } else { natGelExecutableId = new Integer(Integer.parseInt(attrGelExecutableId)); } dataBuff.setOptionalGelExecutableId(natGelExecutableId); // Attempt the create editBuff.copyBuffToPKey(); // Allow for predefined ids ICFGenKbDateFormatterObj created = (ICFGenKbDateFormatterObj) editBuff.create(); editBuff.endEdit(); String response = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgDateFormatterMessageFormatter.formatDateFormatterRspnCreated("\n\t\t\t", created.getDateFormatterBuff()) + "\n" + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); ((CFGenKbXMsgRqstHandler) getParser()).appendResponse(response); } catch (RuntimeException e) { String response = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n" + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); CFGenKbXMsgRqstHandler xmsgRqstHandler = ((CFGenKbXMsgRqstHandler) getParser()); xmsgRqstHandler.resetResponse(); xmsgRqstHandler.appendResponse(response); xmsgRqstHandler.setCaughtException(true); } catch (Error e) { String response = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n" + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); CFGenKbXMsgRqstHandler xmsgRqstHandler = ((CFGenKbXMsgRqstHandler) getParser()); xmsgRqstHandler.resetResponse(); xmsgRqstHandler.appendResponse(response); xmsgRqstHandler.setCaughtException(true); } }
From source file:net.sourceforge.msscodefactory.cfcore.v2_0.CFGenKbXMsgRqstHandler.CFGenKbXMsgRqstTextFormatterCreateHandler.java
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { try {//from www. j a v a 2s . com // Common XML Attributes String attrId = null; String attrRevision = null; // GenItem Attributes String attrTenantId = null; String attrCartridgeId = null; String attrItemId = null; String attrRuleTypeId = null; String attrName = null; String attrToolSetId = null; String attrScopeDefId = null; String attrGenDefId = null; String attrGelExecutableId = null; // GenBind Attributes // GenFormatter Attributes // TextFormatter Attributes // Attribute Extraction String attrLocalName; int numAttrs; int idxAttr; final String S_ProcName = "startElement"; final String S_LocalName = "LocalName"; assert qName.equals("RqstTextFormatterCreate"); CFGenKbXMsgRqstHandler xmsgRqstHandler = (CFGenKbXMsgRqstHandler) getParser(); if (xmsgRqstHandler == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "getParser()"); } ICFGenKbSchemaObj schemaObj = xmsgRqstHandler.getSchemaObj(); if (schemaObj == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "getParser().getSchemaObj()"); } // Instantiate an edit buffer for the parsed information ICFGenKbTextFormatterEditObj editBuff = (ICFGenKbTextFormatterEditObj) schemaObj .getTextFormatterTableObj().newInstance().beginEdit(); CFGenKbTextFormatterBuff dataBuff = editBuff.getTextFormatterBuff(); // Extract Attributes numAttrs = attrs.getLength(); for (idxAttr = 0; idxAttr < numAttrs; idxAttr++) { attrLocalName = attrs.getLocalName(idxAttr); if (attrLocalName.equals("Id")) { if (attrId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("schemaLocation")) { // ignored } else if (attrLocalName.equals("Revision")) { if (attrRevision != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrRevision = attrs.getValue(idxAttr); } else if (attrLocalName.equals("TenantId")) { if (attrTenantId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrTenantId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("CartridgeId")) { if (attrCartridgeId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrCartridgeId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("ItemId")) { if (attrItemId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrItemId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("RuleTypeId")) { if (attrRuleTypeId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrRuleTypeId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("Name")) { if (attrName != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrName = attrs.getValue(idxAttr); } else if (attrLocalName.equals("ToolSetId")) { if (attrToolSetId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrToolSetId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("ScopeDefId")) { if (attrScopeDefId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrScopeDefId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("GenDefId")) { if (attrGenDefId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrGenDefId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("GelExecutableId")) { if (attrGelExecutableId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrGelExecutableId = attrs.getValue(idxAttr); } else { throw CFLib.getDefaultExceptionFactory().newUnrecognizedAttributeException(getClass(), S_ProcName, getParser().getLocationInfo(), attrLocalName); } } // Ensure that required attributes have values if ((attrTenantId == null) || (attrTenantId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "TenantId"); } if ((attrCartridgeId == null) || (attrCartridgeId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "CartridgeId"); } if ((attrItemId == null) || (attrItemId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "ItemId"); } if ((attrRuleTypeId == null) || (attrRuleTypeId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "RuleTypeId"); } if (attrName == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "Name"); } if ((attrToolSetId == null) || (attrToolSetId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "ToolSetId"); } if ((attrGenDefId == null) || (attrGenDefId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "GenDefId"); } // Save named attributes to context CFLibXmlCoreContext curContext = getParser().getCurContext(); // Convert string attributes to native Java types // and apply the converted attributes to the editBuff. long natTenantId = Long.parseLong(attrTenantId); dataBuff.setRequiredTenantId(natTenantId); long natCartridgeId = Long.parseLong(attrCartridgeId); dataBuff.setRequiredCartridgeId(natCartridgeId); short natRuleTypeId = Short.parseShort(attrRuleTypeId); dataBuff.setRequiredRuleTypeId(natRuleTypeId); String natName = attrName; dataBuff.setRequiredName(natName); short natToolSetId = Short.parseShort(attrToolSetId); dataBuff.setRequiredToolSetId(natToolSetId); Short natScopeDefId; if ((attrScopeDefId == null) || (attrScopeDefId.length() <= 0)) { natScopeDefId = null; } else { natScopeDefId = new Short(Short.parseShort(attrScopeDefId)); } dataBuff.setOptionalScopeDefId(natScopeDefId); short natGenDefId = Short.parseShort(attrGenDefId); dataBuff.setRequiredGenDefId(natGenDefId); Integer natGelExecutableId; if ((attrGelExecutableId == null) || (attrGelExecutableId.length() <= 0)) { natGelExecutableId = null; } else { natGelExecutableId = new Integer(Integer.parseInt(attrGelExecutableId)); } dataBuff.setOptionalGelExecutableId(natGelExecutableId); // Attempt the create editBuff.copyBuffToPKey(); // Allow for predefined ids ICFGenKbTextFormatterObj created = (ICFGenKbTextFormatterObj) editBuff.create(); editBuff.endEdit(); String response = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgTextFormatterMessageFormatter.formatTextFormatterRspnCreated("\n\t\t\t", created.getTextFormatterBuff()) + "\n" + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); ((CFGenKbXMsgRqstHandler) getParser()).appendResponse(response); } catch (RuntimeException e) { String response = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n" + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); CFGenKbXMsgRqstHandler xmsgRqstHandler = ((CFGenKbXMsgRqstHandler) getParser()); xmsgRqstHandler.resetResponse(); xmsgRqstHandler.appendResponse(response); xmsgRqstHandler.setCaughtException(true); } catch (Error e) { String response = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n" + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); CFGenKbXMsgRqstHandler xmsgRqstHandler = ((CFGenKbXMsgRqstHandler) getParser()); xmsgRqstHandler.resetResponse(); xmsgRqstHandler.appendResponse(response); xmsgRqstHandler.setCaughtException(true); } }
From source file:net.sourceforge.msscodefactory.cfcore.v2_0.CFGenKbXMsgRqstHandler.CFGenKbXMsgRqstFloatFormatterCreateHandler.java
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { try {/*from w ww . j a v a 2 s .c o m*/ // Common XML Attributes String attrId = null; String attrRevision = null; // GenItem Attributes String attrTenantId = null; String attrCartridgeId = null; String attrItemId = null; String attrRuleTypeId = null; String attrName = null; String attrToolSetId = null; String attrScopeDefId = null; String attrGenDefId = null; String attrGelExecutableId = null; // GenBind Attributes // GenFormatter Attributes // FloatFormatter Attributes // Attribute Extraction String attrLocalName; int numAttrs; int idxAttr; final String S_ProcName = "startElement"; final String S_LocalName = "LocalName"; assert qName.equals("RqstFloatFormatterCreate"); CFGenKbXMsgRqstHandler xmsgRqstHandler = (CFGenKbXMsgRqstHandler) getParser(); if (xmsgRqstHandler == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "getParser()"); } ICFGenKbSchemaObj schemaObj = xmsgRqstHandler.getSchemaObj(); if (schemaObj == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "getParser().getSchemaObj()"); } // Instantiate an edit buffer for the parsed information ICFGenKbFloatFormatterEditObj editBuff = (ICFGenKbFloatFormatterEditObj) schemaObj .getFloatFormatterTableObj().newInstance().beginEdit(); CFGenKbFloatFormatterBuff dataBuff = editBuff.getFloatFormatterBuff(); // Extract Attributes numAttrs = attrs.getLength(); for (idxAttr = 0; idxAttr < numAttrs; idxAttr++) { attrLocalName = attrs.getLocalName(idxAttr); if (attrLocalName.equals("Id")) { if (attrId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("schemaLocation")) { // ignored } else if (attrLocalName.equals("Revision")) { if (attrRevision != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrRevision = attrs.getValue(idxAttr); } else if (attrLocalName.equals("TenantId")) { if (attrTenantId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrTenantId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("CartridgeId")) { if (attrCartridgeId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrCartridgeId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("ItemId")) { if (attrItemId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrItemId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("RuleTypeId")) { if (attrRuleTypeId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrRuleTypeId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("Name")) { if (attrName != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrName = attrs.getValue(idxAttr); } else if (attrLocalName.equals("ToolSetId")) { if (attrToolSetId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrToolSetId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("ScopeDefId")) { if (attrScopeDefId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrScopeDefId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("GenDefId")) { if (attrGenDefId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrGenDefId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("GelExecutableId")) { if (attrGelExecutableId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrGelExecutableId = attrs.getValue(idxAttr); } else { throw CFLib.getDefaultExceptionFactory().newUnrecognizedAttributeException(getClass(), S_ProcName, getParser().getLocationInfo(), attrLocalName); } } // Ensure that required attributes have values if ((attrTenantId == null) || (attrTenantId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "TenantId"); } if ((attrCartridgeId == null) || (attrCartridgeId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "CartridgeId"); } if ((attrItemId == null) || (attrItemId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "ItemId"); } if ((attrRuleTypeId == null) || (attrRuleTypeId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "RuleTypeId"); } if (attrName == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "Name"); } if ((attrToolSetId == null) || (attrToolSetId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "ToolSetId"); } if ((attrGenDefId == null) || (attrGenDefId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "GenDefId"); } // Save named attributes to context CFLibXmlCoreContext curContext = getParser().getCurContext(); // Convert string attributes to native Java types // and apply the converted attributes to the editBuff. long natTenantId = Long.parseLong(attrTenantId); dataBuff.setRequiredTenantId(natTenantId); long natCartridgeId = Long.parseLong(attrCartridgeId); dataBuff.setRequiredCartridgeId(natCartridgeId); short natRuleTypeId = Short.parseShort(attrRuleTypeId); dataBuff.setRequiredRuleTypeId(natRuleTypeId); String natName = attrName; dataBuff.setRequiredName(natName); short natToolSetId = Short.parseShort(attrToolSetId); dataBuff.setRequiredToolSetId(natToolSetId); Short natScopeDefId; if ((attrScopeDefId == null) || (attrScopeDefId.length() <= 0)) { natScopeDefId = null; } else { natScopeDefId = new Short(Short.parseShort(attrScopeDefId)); } dataBuff.setOptionalScopeDefId(natScopeDefId); short natGenDefId = Short.parseShort(attrGenDefId); dataBuff.setRequiredGenDefId(natGenDefId); Integer natGelExecutableId; if ((attrGelExecutableId == null) || (attrGelExecutableId.length() <= 0)) { natGelExecutableId = null; } else { natGelExecutableId = new Integer(Integer.parseInt(attrGelExecutableId)); } dataBuff.setOptionalGelExecutableId(natGelExecutableId); // Attempt the create editBuff.copyBuffToPKey(); // Allow for predefined ids ICFGenKbFloatFormatterObj created = (ICFGenKbFloatFormatterObj) editBuff.create(); editBuff.endEdit(); String response = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgFloatFormatterMessageFormatter.formatFloatFormatterRspnCreated("\n\t\t\t", created.getFloatFormatterBuff()) + "\n" + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); ((CFGenKbXMsgRqstHandler) getParser()).appendResponse(response); } catch (RuntimeException e) { String response = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n" + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); CFGenKbXMsgRqstHandler xmsgRqstHandler = ((CFGenKbXMsgRqstHandler) getParser()); xmsgRqstHandler.resetResponse(); xmsgRqstHandler.appendResponse(response); xmsgRqstHandler.setCaughtException(true); } catch (Error e) { String response = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n" + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); CFGenKbXMsgRqstHandler xmsgRqstHandler = ((CFGenKbXMsgRqstHandler) getParser()); xmsgRqstHandler.resetResponse(); xmsgRqstHandler.appendResponse(response); xmsgRqstHandler.setCaughtException(true); } }
From source file:net.sourceforge.msscodefactory.cfcore.v2_0.CFGenKbXMsgRqstHandler.CFGenKbXMsgRqstInt16FormatterCreateHandler.java
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { try {/*from ww w.j a v a 2 s . co m*/ // Common XML Attributes String attrId = null; String attrRevision = null; // GenItem Attributes String attrTenantId = null; String attrCartridgeId = null; String attrItemId = null; String attrRuleTypeId = null; String attrName = null; String attrToolSetId = null; String attrScopeDefId = null; String attrGenDefId = null; String attrGelExecutableId = null; // GenBind Attributes // GenFormatter Attributes // Int16Formatter Attributes // Attribute Extraction String attrLocalName; int numAttrs; int idxAttr; final String S_ProcName = "startElement"; final String S_LocalName = "LocalName"; assert qName.equals("RqstInt16FormatterCreate"); CFGenKbXMsgRqstHandler xmsgRqstHandler = (CFGenKbXMsgRqstHandler) getParser(); if (xmsgRqstHandler == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "getParser()"); } ICFGenKbSchemaObj schemaObj = xmsgRqstHandler.getSchemaObj(); if (schemaObj == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "getParser().getSchemaObj()"); } // Instantiate an edit buffer for the parsed information ICFGenKbInt16FormatterEditObj editBuff = (ICFGenKbInt16FormatterEditObj) schemaObj .getInt16FormatterTableObj().newInstance().beginEdit(); CFGenKbInt16FormatterBuff dataBuff = editBuff.getInt16FormatterBuff(); // Extract Attributes numAttrs = attrs.getLength(); for (idxAttr = 0; idxAttr < numAttrs; idxAttr++) { attrLocalName = attrs.getLocalName(idxAttr); if (attrLocalName.equals("Id")) { if (attrId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("schemaLocation")) { // ignored } else if (attrLocalName.equals("Revision")) { if (attrRevision != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrRevision = attrs.getValue(idxAttr); } else if (attrLocalName.equals("TenantId")) { if (attrTenantId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrTenantId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("CartridgeId")) { if (attrCartridgeId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrCartridgeId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("ItemId")) { if (attrItemId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrItemId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("RuleTypeId")) { if (attrRuleTypeId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrRuleTypeId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("Name")) { if (attrName != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrName = attrs.getValue(idxAttr); } else if (attrLocalName.equals("ToolSetId")) { if (attrToolSetId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrToolSetId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("ScopeDefId")) { if (attrScopeDefId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrScopeDefId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("GenDefId")) { if (attrGenDefId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrGenDefId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("GelExecutableId")) { if (attrGelExecutableId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrGelExecutableId = attrs.getValue(idxAttr); } else { throw CFLib.getDefaultExceptionFactory().newUnrecognizedAttributeException(getClass(), S_ProcName, getParser().getLocationInfo(), attrLocalName); } } // Ensure that required attributes have values if ((attrTenantId == null) || (attrTenantId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "TenantId"); } if ((attrCartridgeId == null) || (attrCartridgeId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "CartridgeId"); } if ((attrItemId == null) || (attrItemId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "ItemId"); } if ((attrRuleTypeId == null) || (attrRuleTypeId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "RuleTypeId"); } if (attrName == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "Name"); } if ((attrToolSetId == null) || (attrToolSetId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "ToolSetId"); } if ((attrGenDefId == null) || (attrGenDefId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "GenDefId"); } // Save named attributes to context CFLibXmlCoreContext curContext = getParser().getCurContext(); // Convert string attributes to native Java types // and apply the converted attributes to the editBuff. long natTenantId = Long.parseLong(attrTenantId); dataBuff.setRequiredTenantId(natTenantId); long natCartridgeId = Long.parseLong(attrCartridgeId); dataBuff.setRequiredCartridgeId(natCartridgeId); short natRuleTypeId = Short.parseShort(attrRuleTypeId); dataBuff.setRequiredRuleTypeId(natRuleTypeId); String natName = attrName; dataBuff.setRequiredName(natName); short natToolSetId = Short.parseShort(attrToolSetId); dataBuff.setRequiredToolSetId(natToolSetId); Short natScopeDefId; if ((attrScopeDefId == null) || (attrScopeDefId.length() <= 0)) { natScopeDefId = null; } else { natScopeDefId = new Short(Short.parseShort(attrScopeDefId)); } dataBuff.setOptionalScopeDefId(natScopeDefId); short natGenDefId = Short.parseShort(attrGenDefId); dataBuff.setRequiredGenDefId(natGenDefId); Integer natGelExecutableId; if ((attrGelExecutableId == null) || (attrGelExecutableId.length() <= 0)) { natGelExecutableId = null; } else { natGelExecutableId = new Integer(Integer.parseInt(attrGelExecutableId)); } dataBuff.setOptionalGelExecutableId(natGelExecutableId); // Attempt the create editBuff.copyBuffToPKey(); // Allow for predefined ids ICFGenKbInt16FormatterObj created = (ICFGenKbInt16FormatterObj) editBuff.create(); editBuff.endEdit(); String response = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgInt16FormatterMessageFormatter.formatInt16FormatterRspnCreated("\n\t\t\t", created.getInt16FormatterBuff()) + "\n" + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); ((CFGenKbXMsgRqstHandler) getParser()).appendResponse(response); } catch (RuntimeException e) { String response = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n" + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); CFGenKbXMsgRqstHandler xmsgRqstHandler = ((CFGenKbXMsgRqstHandler) getParser()); xmsgRqstHandler.resetResponse(); xmsgRqstHandler.appendResponse(response); xmsgRqstHandler.setCaughtException(true); } catch (Error e) { String response = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n" + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); CFGenKbXMsgRqstHandler xmsgRqstHandler = ((CFGenKbXMsgRqstHandler) getParser()); xmsgRqstHandler.resetResponse(); xmsgRqstHandler.appendResponse(response); xmsgRqstHandler.setCaughtException(true); } }
From source file:net.sourceforge.msscodefactory.cfcore.v2_0.CFGenKbXMsgRqstHandler.CFGenKbXMsgRqstInt32FormatterCreateHandler.java
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { try {// www. j av a 2s . com // Common XML Attributes String attrId = null; String attrRevision = null; // GenItem Attributes String attrTenantId = null; String attrCartridgeId = null; String attrItemId = null; String attrRuleTypeId = null; String attrName = null; String attrToolSetId = null; String attrScopeDefId = null; String attrGenDefId = null; String attrGelExecutableId = null; // GenBind Attributes // GenFormatter Attributes // Int32Formatter Attributes // Attribute Extraction String attrLocalName; int numAttrs; int idxAttr; final String S_ProcName = "startElement"; final String S_LocalName = "LocalName"; assert qName.equals("RqstInt32FormatterCreate"); CFGenKbXMsgRqstHandler xmsgRqstHandler = (CFGenKbXMsgRqstHandler) getParser(); if (xmsgRqstHandler == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "getParser()"); } ICFGenKbSchemaObj schemaObj = xmsgRqstHandler.getSchemaObj(); if (schemaObj == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "getParser().getSchemaObj()"); } // Instantiate an edit buffer for the parsed information ICFGenKbInt32FormatterEditObj editBuff = (ICFGenKbInt32FormatterEditObj) schemaObj .getInt32FormatterTableObj().newInstance().beginEdit(); CFGenKbInt32FormatterBuff dataBuff = editBuff.getInt32FormatterBuff(); // Extract Attributes numAttrs = attrs.getLength(); for (idxAttr = 0; idxAttr < numAttrs; idxAttr++) { attrLocalName = attrs.getLocalName(idxAttr); if (attrLocalName.equals("Id")) { if (attrId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("schemaLocation")) { // ignored } else if (attrLocalName.equals("Revision")) { if (attrRevision != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrRevision = attrs.getValue(idxAttr); } else if (attrLocalName.equals("TenantId")) { if (attrTenantId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrTenantId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("CartridgeId")) { if (attrCartridgeId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrCartridgeId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("ItemId")) { if (attrItemId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrItemId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("RuleTypeId")) { if (attrRuleTypeId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrRuleTypeId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("Name")) { if (attrName != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrName = attrs.getValue(idxAttr); } else if (attrLocalName.equals("ToolSetId")) { if (attrToolSetId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrToolSetId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("ScopeDefId")) { if (attrScopeDefId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrScopeDefId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("GenDefId")) { if (attrGenDefId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrGenDefId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("GelExecutableId")) { if (attrGelExecutableId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrGelExecutableId = attrs.getValue(idxAttr); } else { throw CFLib.getDefaultExceptionFactory().newUnrecognizedAttributeException(getClass(), S_ProcName, getParser().getLocationInfo(), attrLocalName); } } // Ensure that required attributes have values if ((attrTenantId == null) || (attrTenantId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "TenantId"); } if ((attrCartridgeId == null) || (attrCartridgeId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "CartridgeId"); } if ((attrItemId == null) || (attrItemId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "ItemId"); } if ((attrRuleTypeId == null) || (attrRuleTypeId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "RuleTypeId"); } if (attrName == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "Name"); } if ((attrToolSetId == null) || (attrToolSetId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "ToolSetId"); } if ((attrGenDefId == null) || (attrGenDefId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "GenDefId"); } // Save named attributes to context CFLibXmlCoreContext curContext = getParser().getCurContext(); // Convert string attributes to native Java types // and apply the converted attributes to the editBuff. long natTenantId = Long.parseLong(attrTenantId); dataBuff.setRequiredTenantId(natTenantId); long natCartridgeId = Long.parseLong(attrCartridgeId); dataBuff.setRequiredCartridgeId(natCartridgeId); short natRuleTypeId = Short.parseShort(attrRuleTypeId); dataBuff.setRequiredRuleTypeId(natRuleTypeId); String natName = attrName; dataBuff.setRequiredName(natName); short natToolSetId = Short.parseShort(attrToolSetId); dataBuff.setRequiredToolSetId(natToolSetId); Short natScopeDefId; if ((attrScopeDefId == null) || (attrScopeDefId.length() <= 0)) { natScopeDefId = null; } else { natScopeDefId = new Short(Short.parseShort(attrScopeDefId)); } dataBuff.setOptionalScopeDefId(natScopeDefId); short natGenDefId = Short.parseShort(attrGenDefId); dataBuff.setRequiredGenDefId(natGenDefId); Integer natGelExecutableId; if ((attrGelExecutableId == null) || (attrGelExecutableId.length() <= 0)) { natGelExecutableId = null; } else { natGelExecutableId = new Integer(Integer.parseInt(attrGelExecutableId)); } dataBuff.setOptionalGelExecutableId(natGelExecutableId); // Attempt the create editBuff.copyBuffToPKey(); // Allow for predefined ids ICFGenKbInt32FormatterObj created = (ICFGenKbInt32FormatterObj) editBuff.create(); editBuff.endEdit(); String response = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgInt32FormatterMessageFormatter.formatInt32FormatterRspnCreated("\n\t\t\t", created.getInt32FormatterBuff()) + "\n" + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); ((CFGenKbXMsgRqstHandler) getParser()).appendResponse(response); } catch (RuntimeException e) { String response = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n" + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); CFGenKbXMsgRqstHandler xmsgRqstHandler = ((CFGenKbXMsgRqstHandler) getParser()); xmsgRqstHandler.resetResponse(); xmsgRqstHandler.appendResponse(response); xmsgRqstHandler.setCaughtException(true); } catch (Error e) { String response = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n" + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); CFGenKbXMsgRqstHandler xmsgRqstHandler = ((CFGenKbXMsgRqstHandler) getParser()); xmsgRqstHandler.resetResponse(); xmsgRqstHandler.appendResponse(response); xmsgRqstHandler.setCaughtException(true); } }
From source file:net.sourceforge.msscodefactory.cfcore.v2_0.CFGenKbXMsgRqstHandler.CFGenKbXMsgRqstInt64FormatterCreateHandler.java
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { try {/* www . j a va 2 s . c o m*/ // Common XML Attributes String attrId = null; String attrRevision = null; // GenItem Attributes String attrTenantId = null; String attrCartridgeId = null; String attrItemId = null; String attrRuleTypeId = null; String attrName = null; String attrToolSetId = null; String attrScopeDefId = null; String attrGenDefId = null; String attrGelExecutableId = null; // GenBind Attributes // GenFormatter Attributes // Int64Formatter Attributes // Attribute Extraction String attrLocalName; int numAttrs; int idxAttr; final String S_ProcName = "startElement"; final String S_LocalName = "LocalName"; assert qName.equals("RqstInt64FormatterCreate"); CFGenKbXMsgRqstHandler xmsgRqstHandler = (CFGenKbXMsgRqstHandler) getParser(); if (xmsgRqstHandler == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "getParser()"); } ICFGenKbSchemaObj schemaObj = xmsgRqstHandler.getSchemaObj(); if (schemaObj == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "getParser().getSchemaObj()"); } // Instantiate an edit buffer for the parsed information ICFGenKbInt64FormatterEditObj editBuff = (ICFGenKbInt64FormatterEditObj) schemaObj .getInt64FormatterTableObj().newInstance().beginEdit(); CFGenKbInt64FormatterBuff dataBuff = editBuff.getInt64FormatterBuff(); // Extract Attributes numAttrs = attrs.getLength(); for (idxAttr = 0; idxAttr < numAttrs; idxAttr++) { attrLocalName = attrs.getLocalName(idxAttr); if (attrLocalName.equals("Id")) { if (attrId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("schemaLocation")) { // ignored } else if (attrLocalName.equals("Revision")) { if (attrRevision != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrRevision = attrs.getValue(idxAttr); } else if (attrLocalName.equals("TenantId")) { if (attrTenantId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrTenantId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("CartridgeId")) { if (attrCartridgeId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrCartridgeId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("ItemId")) { if (attrItemId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrItemId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("RuleTypeId")) { if (attrRuleTypeId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrRuleTypeId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("Name")) { if (attrName != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrName = attrs.getValue(idxAttr); } else if (attrLocalName.equals("ToolSetId")) { if (attrToolSetId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrToolSetId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("ScopeDefId")) { if (attrScopeDefId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrScopeDefId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("GenDefId")) { if (attrGenDefId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrGenDefId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("GelExecutableId")) { if (attrGelExecutableId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrGelExecutableId = attrs.getValue(idxAttr); } else { throw CFLib.getDefaultExceptionFactory().newUnrecognizedAttributeException(getClass(), S_ProcName, getParser().getLocationInfo(), attrLocalName); } } // Ensure that required attributes have values if ((attrTenantId == null) || (attrTenantId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "TenantId"); } if ((attrCartridgeId == null) || (attrCartridgeId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "CartridgeId"); } if ((attrItemId == null) || (attrItemId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "ItemId"); } if ((attrRuleTypeId == null) || (attrRuleTypeId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "RuleTypeId"); } if (attrName == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "Name"); } if ((attrToolSetId == null) || (attrToolSetId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "ToolSetId"); } if ((attrGenDefId == null) || (attrGenDefId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "GenDefId"); } // Save named attributes to context CFLibXmlCoreContext curContext = getParser().getCurContext(); // Convert string attributes to native Java types // and apply the converted attributes to the editBuff. long natTenantId = Long.parseLong(attrTenantId); dataBuff.setRequiredTenantId(natTenantId); long natCartridgeId = Long.parseLong(attrCartridgeId); dataBuff.setRequiredCartridgeId(natCartridgeId); short natRuleTypeId = Short.parseShort(attrRuleTypeId); dataBuff.setRequiredRuleTypeId(natRuleTypeId); String natName = attrName; dataBuff.setRequiredName(natName); short natToolSetId = Short.parseShort(attrToolSetId); dataBuff.setRequiredToolSetId(natToolSetId); Short natScopeDefId; if ((attrScopeDefId == null) || (attrScopeDefId.length() <= 0)) { natScopeDefId = null; } else { natScopeDefId = new Short(Short.parseShort(attrScopeDefId)); } dataBuff.setOptionalScopeDefId(natScopeDefId); short natGenDefId = Short.parseShort(attrGenDefId); dataBuff.setRequiredGenDefId(natGenDefId); Integer natGelExecutableId; if ((attrGelExecutableId == null) || (attrGelExecutableId.length() <= 0)) { natGelExecutableId = null; } else { natGelExecutableId = new Integer(Integer.parseInt(attrGelExecutableId)); } dataBuff.setOptionalGelExecutableId(natGelExecutableId); // Attempt the create editBuff.copyBuffToPKey(); // Allow for predefined ids ICFGenKbInt64FormatterObj created = (ICFGenKbInt64FormatterObj) editBuff.create(); editBuff.endEdit(); String response = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgInt64FormatterMessageFormatter.formatInt64FormatterRspnCreated("\n\t\t\t", created.getInt64FormatterBuff()) + "\n" + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); ((CFGenKbXMsgRqstHandler) getParser()).appendResponse(response); } catch (RuntimeException e) { String response = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n" + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); CFGenKbXMsgRqstHandler xmsgRqstHandler = ((CFGenKbXMsgRqstHandler) getParser()); xmsgRqstHandler.resetResponse(); xmsgRqstHandler.appendResponse(response); xmsgRqstHandler.setCaughtException(true); } catch (Error e) { String response = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n" + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); CFGenKbXMsgRqstHandler xmsgRqstHandler = ((CFGenKbXMsgRqstHandler) getParser()); xmsgRqstHandler.resetResponse(); xmsgRqstHandler.appendResponse(response); xmsgRqstHandler.setCaughtException(true); } }
From source file:net.sourceforge.msscodefactory.cfcore.v2_0.CFGenKbXMsgRqstHandler.CFGenKbXMsgRqstDoubleFormatterCreateHandler.java
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { try {/*ww w .j a v a 2s .c o m*/ // Common XML Attributes String attrId = null; String attrRevision = null; // GenItem Attributes String attrTenantId = null; String attrCartridgeId = null; String attrItemId = null; String attrRuleTypeId = null; String attrName = null; String attrToolSetId = null; String attrScopeDefId = null; String attrGenDefId = null; String attrGelExecutableId = null; // GenBind Attributes // GenFormatter Attributes // DoubleFormatter Attributes // Attribute Extraction String attrLocalName; int numAttrs; int idxAttr; final String S_ProcName = "startElement"; final String S_LocalName = "LocalName"; assert qName.equals("RqstDoubleFormatterCreate"); CFGenKbXMsgRqstHandler xmsgRqstHandler = (CFGenKbXMsgRqstHandler) getParser(); if (xmsgRqstHandler == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "getParser()"); } ICFGenKbSchemaObj schemaObj = xmsgRqstHandler.getSchemaObj(); if (schemaObj == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "getParser().getSchemaObj()"); } // Instantiate an edit buffer for the parsed information ICFGenKbDoubleFormatterEditObj editBuff = (ICFGenKbDoubleFormatterEditObj) schemaObj .getDoubleFormatterTableObj().newInstance().beginEdit(); CFGenKbDoubleFormatterBuff dataBuff = editBuff.getDoubleFormatterBuff(); // Extract Attributes numAttrs = attrs.getLength(); for (idxAttr = 0; idxAttr < numAttrs; idxAttr++) { attrLocalName = attrs.getLocalName(idxAttr); if (attrLocalName.equals("Id")) { if (attrId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("schemaLocation")) { // ignored } else if (attrLocalName.equals("Revision")) { if (attrRevision != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrRevision = attrs.getValue(idxAttr); } else if (attrLocalName.equals("TenantId")) { if (attrTenantId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrTenantId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("CartridgeId")) { if (attrCartridgeId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrCartridgeId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("ItemId")) { if (attrItemId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrItemId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("RuleTypeId")) { if (attrRuleTypeId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrRuleTypeId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("Name")) { if (attrName != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrName = attrs.getValue(idxAttr); } else if (attrLocalName.equals("ToolSetId")) { if (attrToolSetId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrToolSetId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("ScopeDefId")) { if (attrScopeDefId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrScopeDefId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("GenDefId")) { if (attrGenDefId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrGenDefId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("GelExecutableId")) { if (attrGelExecutableId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrGelExecutableId = attrs.getValue(idxAttr); } else { throw CFLib.getDefaultExceptionFactory().newUnrecognizedAttributeException(getClass(), S_ProcName, getParser().getLocationInfo(), attrLocalName); } } // Ensure that required attributes have values if ((attrTenantId == null) || (attrTenantId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "TenantId"); } if ((attrCartridgeId == null) || (attrCartridgeId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "CartridgeId"); } if ((attrItemId == null) || (attrItemId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "ItemId"); } if ((attrRuleTypeId == null) || (attrRuleTypeId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "RuleTypeId"); } if (attrName == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "Name"); } if ((attrToolSetId == null) || (attrToolSetId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "ToolSetId"); } if ((attrGenDefId == null) || (attrGenDefId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "GenDefId"); } // Save named attributes to context CFLibXmlCoreContext curContext = getParser().getCurContext(); // Convert string attributes to native Java types // and apply the converted attributes to the editBuff. long natTenantId = Long.parseLong(attrTenantId); dataBuff.setRequiredTenantId(natTenantId); long natCartridgeId = Long.parseLong(attrCartridgeId); dataBuff.setRequiredCartridgeId(natCartridgeId); short natRuleTypeId = Short.parseShort(attrRuleTypeId); dataBuff.setRequiredRuleTypeId(natRuleTypeId); String natName = attrName; dataBuff.setRequiredName(natName); short natToolSetId = Short.parseShort(attrToolSetId); dataBuff.setRequiredToolSetId(natToolSetId); Short natScopeDefId; if ((attrScopeDefId == null) || (attrScopeDefId.length() <= 0)) { natScopeDefId = null; } else { natScopeDefId = new Short(Short.parseShort(attrScopeDefId)); } dataBuff.setOptionalScopeDefId(natScopeDefId); short natGenDefId = Short.parseShort(attrGenDefId); dataBuff.setRequiredGenDefId(natGenDefId); Integer natGelExecutableId; if ((attrGelExecutableId == null) || (attrGelExecutableId.length() <= 0)) { natGelExecutableId = null; } else { natGelExecutableId = new Integer(Integer.parseInt(attrGelExecutableId)); } dataBuff.setOptionalGelExecutableId(natGelExecutableId); // Attempt the create editBuff.copyBuffToPKey(); // Allow for predefined ids ICFGenKbDoubleFormatterObj created = (ICFGenKbDoubleFormatterObj) editBuff.create(); editBuff.endEdit(); String response = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgDoubleFormatterMessageFormatter.formatDoubleFormatterRspnCreated("\n\t\t\t", created.getDoubleFormatterBuff()) + "\n" + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); ((CFGenKbXMsgRqstHandler) getParser()).appendResponse(response); } catch (RuntimeException e) { String response = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n" + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); CFGenKbXMsgRqstHandler xmsgRqstHandler = ((CFGenKbXMsgRqstHandler) getParser()); xmsgRqstHandler.resetResponse(); xmsgRqstHandler.appendResponse(response); xmsgRqstHandler.setCaughtException(true); } catch (Error e) { String response = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n" + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); CFGenKbXMsgRqstHandler xmsgRqstHandler = ((CFGenKbXMsgRqstHandler) getParser()); xmsgRqstHandler.resetResponse(); xmsgRqstHandler.appendResponse(response); xmsgRqstHandler.setCaughtException(true); } }
From source file:net.sourceforge.msscodefactory.cfcore.v2_0.CFGenKbXMsgRqstHandler.CFGenKbXMsgRqstNmTokenFormatterCreateHandler.java
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { try {//from w w w. j a v a 2 s . co m // Common XML Attributes String attrId = null; String attrRevision = null; // GenItem Attributes String attrTenantId = null; String attrCartridgeId = null; String attrItemId = null; String attrRuleTypeId = null; String attrName = null; String attrToolSetId = null; String attrScopeDefId = null; String attrGenDefId = null; String attrGelExecutableId = null; // GenBind Attributes // GenFormatter Attributes // NmTokenFormatter Attributes // Attribute Extraction String attrLocalName; int numAttrs; int idxAttr; final String S_ProcName = "startElement"; final String S_LocalName = "LocalName"; assert qName.equals("RqstNmTokenFormatterCreate"); CFGenKbXMsgRqstHandler xmsgRqstHandler = (CFGenKbXMsgRqstHandler) getParser(); if (xmsgRqstHandler == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "getParser()"); } ICFGenKbSchemaObj schemaObj = xmsgRqstHandler.getSchemaObj(); if (schemaObj == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "getParser().getSchemaObj()"); } // Instantiate an edit buffer for the parsed information ICFGenKbNmTokenFormatterEditObj editBuff = (ICFGenKbNmTokenFormatterEditObj) schemaObj .getNmTokenFormatterTableObj().newInstance().beginEdit(); CFGenKbNmTokenFormatterBuff dataBuff = editBuff.getNmTokenFormatterBuff(); // Extract Attributes numAttrs = attrs.getLength(); for (idxAttr = 0; idxAttr < numAttrs; idxAttr++) { attrLocalName = attrs.getLocalName(idxAttr); if (attrLocalName.equals("Id")) { if (attrId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("schemaLocation")) { // ignored } else if (attrLocalName.equals("Revision")) { if (attrRevision != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrRevision = attrs.getValue(idxAttr); } else if (attrLocalName.equals("TenantId")) { if (attrTenantId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrTenantId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("CartridgeId")) { if (attrCartridgeId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrCartridgeId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("ItemId")) { if (attrItemId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrItemId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("RuleTypeId")) { if (attrRuleTypeId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrRuleTypeId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("Name")) { if (attrName != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrName = attrs.getValue(idxAttr); } else if (attrLocalName.equals("ToolSetId")) { if (attrToolSetId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrToolSetId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("ScopeDefId")) { if (attrScopeDefId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrScopeDefId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("GenDefId")) { if (attrGenDefId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrGenDefId = attrs.getValue(idxAttr); } else if (attrLocalName.equals("GelExecutableId")) { if (attrGelExecutableId != null) { throw CFLib.getDefaultExceptionFactory().newUniqueIndexViolationException(getClass(), S_ProcName, S_LocalName, attrLocalName); } attrGelExecutableId = attrs.getValue(idxAttr); } else { throw CFLib.getDefaultExceptionFactory().newUnrecognizedAttributeException(getClass(), S_ProcName, getParser().getLocationInfo(), attrLocalName); } } // Ensure that required attributes have values if ((attrTenantId == null) || (attrTenantId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "TenantId"); } if ((attrCartridgeId == null) || (attrCartridgeId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "CartridgeId"); } if ((attrItemId == null) || (attrItemId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "ItemId"); } if ((attrRuleTypeId == null) || (attrRuleTypeId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "RuleTypeId"); } if (attrName == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "Name"); } if ((attrToolSetId == null) || (attrToolSetId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "ToolSetId"); } if ((attrGenDefId == null) || (attrGenDefId.length() <= 0)) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "GenDefId"); } // Save named attributes to context CFLibXmlCoreContext curContext = getParser().getCurContext(); // Convert string attributes to native Java types // and apply the converted attributes to the editBuff. long natTenantId = Long.parseLong(attrTenantId); dataBuff.setRequiredTenantId(natTenantId); long natCartridgeId = Long.parseLong(attrCartridgeId); dataBuff.setRequiredCartridgeId(natCartridgeId); short natRuleTypeId = Short.parseShort(attrRuleTypeId); dataBuff.setRequiredRuleTypeId(natRuleTypeId); String natName = attrName; dataBuff.setRequiredName(natName); short natToolSetId = Short.parseShort(attrToolSetId); dataBuff.setRequiredToolSetId(natToolSetId); Short natScopeDefId; if ((attrScopeDefId == null) || (attrScopeDefId.length() <= 0)) { natScopeDefId = null; } else { natScopeDefId = new Short(Short.parseShort(attrScopeDefId)); } dataBuff.setOptionalScopeDefId(natScopeDefId); short natGenDefId = Short.parseShort(attrGenDefId); dataBuff.setRequiredGenDefId(natGenDefId); Integer natGelExecutableId; if ((attrGelExecutableId == null) || (attrGelExecutableId.length() <= 0)) { natGelExecutableId = null; } else { natGelExecutableId = new Integer(Integer.parseInt(attrGelExecutableId)); } dataBuff.setOptionalGelExecutableId(natGelExecutableId); // Attempt the create editBuff.copyBuffToPKey(); // Allow for predefined ids ICFGenKbNmTokenFormatterObj created = (ICFGenKbNmTokenFormatterObj) editBuff.create(); editBuff.endEdit(); String response = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgNmTokenFormatterMessageFormatter.formatNmTokenFormatterRspnCreated("\n\t\t\t", created.getNmTokenFormatterBuff()) + "\n" + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); ((CFGenKbXMsgRqstHandler) getParser()).appendResponse(response); } catch (RuntimeException e) { String response = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n" + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); CFGenKbXMsgRqstHandler xmsgRqstHandler = ((CFGenKbXMsgRqstHandler) getParser()); xmsgRqstHandler.resetResponse(); xmsgRqstHandler.appendResponse(response); xmsgRqstHandler.setCaughtException(true); } catch (Error e) { String response = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n" + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); CFGenKbXMsgRqstHandler xmsgRqstHandler = ((CFGenKbXMsgRqstHandler) getParser()); xmsgRqstHandler.resetResponse(); xmsgRqstHandler.appendResponse(response); xmsgRqstHandler.setCaughtException(true); } }