List of usage examples for java.util SortedMap values
Collection<V> values();
From source file:net.sourceforge.msscodefactory.cfcore.v2_0.CFGenKbXMsgRqstHandler.CFGenKbXMsgRqstISOTimezoneReadAllHandler.java
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { try {/*from w ww. j a v a 2s. c om*/ // Common XML Attributes String attrId = null; // Attribute Extraction String attrLocalName; int numAttrs; int idxAttr; final String S_ProcName = "startElement"; final String S_LocalName = "LocalName"; assert qName.equals("RqstISOTimezoneReadAll"); 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()"); } // 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 { throw CFLib.getDefaultExceptionFactory().newUnrecognizedAttributeException(getClass(), S_ProcName, getParser().getLocationInfo(), attrLocalName); } } // Save named attributes to context CFLibXmlCoreContext curContext = getParser().getCurContext(); // Read the objects and prepare the response XML SortedMap<CFGenKbISOTimezonePKey, ICFGenKbISOTimezoneObj> map = schemaObj.getISOTimezoneTableObj() .readAllISOTimezone(true); String responseOpening = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgISOTimezoneMessageFormatter.formatISOTimezoneRspnListOpenTag(); xmsgRqstHandler.appendResponse(responseOpening); Iterator<ICFGenKbISOTimezoneObj> iter = map.values().iterator(); ICFGenKbISOTimezoneObj cur; String subxml; while (iter.hasNext()) { cur = iter.next(); subxml = CFGenKbXMsgISOTimezoneMessageFormatter.formatISOTimezoneRspnDerivedRec("\n\t\t", cur.getISOTimezoneBuff()); xmsgRqstHandler.appendResponse(subxml); } String responseClosing = "\n" + "\t" + CFGenKbXMsgISOTimezoneMessageFormatter.formatISOTimezoneRspnListCloseTag() + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); xmsgRqstHandler.appendResponse(responseClosing); } 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.CFGenKbXMsgRqstServiceTypeReadAllHandler.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; // Attribute Extraction String attrLocalName; int numAttrs; int idxAttr; final String S_ProcName = "startElement"; final String S_LocalName = "LocalName"; assert qName.equals("RqstServiceTypeReadAll"); 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()"); } // 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 { throw CFLib.getDefaultExceptionFactory().newUnrecognizedAttributeException(getClass(), S_ProcName, getParser().getLocationInfo(), attrLocalName); } } // Save named attributes to context CFLibXmlCoreContext curContext = getParser().getCurContext(); // Read the objects and prepare the response XML SortedMap<CFGenKbServiceTypePKey, ICFGenKbServiceTypeObj> map = schemaObj.getServiceTypeTableObj() .readAllServiceType(true); String responseOpening = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgServiceTypeMessageFormatter.formatServiceTypeRspnListOpenTag(); xmsgRqstHandler.appendResponse(responseOpening); Iterator<ICFGenKbServiceTypeObj> iter = map.values().iterator(); ICFGenKbServiceTypeObj cur; String subxml; while (iter.hasNext()) { cur = iter.next(); subxml = CFGenKbXMsgServiceTypeMessageFormatter.formatServiceTypeRspnDerivedRec("\n\t\t", cur.getServiceTypeBuff()); xmsgRqstHandler.appendResponse(subxml); } String responseClosing = "\n" + "\t" + CFGenKbXMsgServiceTypeMessageFormatter.formatServiceTypeRspnListCloseTag() + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); xmsgRqstHandler.appendResponse(responseClosing); } 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.cfgcash.v2_0.CFGCashXMsgRqstHandler.CFGCashXMsgRqstISOLanguageReadAllHandler.java
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { try {//w ww . j a v a2 s. c o m // Common XML Attributes String attrId = null; // Attribute Extraction String attrLocalName; int numAttrs; int idxAttr; final String S_ProcName = "startElement"; final String S_LocalName = "LocalName"; assert qName.equals("RqstISOLanguageReadAll"); CFGCashXMsgRqstHandler xmsgRqstHandler = (CFGCashXMsgRqstHandler) getParser(); if (xmsgRqstHandler == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "getParser()"); } ICFGCashSchemaObj schemaObj = xmsgRqstHandler.getSchemaObj(); if (schemaObj == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "getParser().getSchemaObj()"); } // 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 { throw CFLib.getDefaultExceptionFactory().newUnrecognizedAttributeException(getClass(), S_ProcName, getParser().getLocationInfo(), attrLocalName); } } // Save named attributes to context CFLibXmlCoreContext curContext = getParser().getCurContext(); // Read the objects and prepare the response XML SortedMap<CFGCashISOLanguagePKey, ICFGCashISOLanguageObj> map = schemaObj.getISOLanguageTableObj() .readAllISOLanguage(true); String responseOpening = CFGCashXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGCashXMsgISOLanguageMessageFormatter.formatISOLanguageRspnListOpenTag(); xmsgRqstHandler.appendResponse(responseOpening); Iterator<ICFGCashISOLanguageObj> iter = map.values().iterator(); ICFGCashISOLanguageObj cur; String subxml; while (iter.hasNext()) { cur = iter.next(); subxml = CFGCashXMsgISOLanguageMessageFormatter.formatISOLanguageRspnDerivedRec("\n\t\t", cur.getISOLanguageBuff()); xmsgRqstHandler.appendResponse(subxml); } String responseClosing = "\n" + "\t" + CFGCashXMsgISOLanguageMessageFormatter.formatISOLanguageRspnListCloseTag() + CFGCashXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); xmsgRqstHandler.appendResponse(responseClosing); } catch (RuntimeException e) { String response = CFGCashXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGCashXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n" + CFGCashXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); CFGCashXMsgRqstHandler xmsgRqstHandler = ((CFGCashXMsgRqstHandler) getParser()); xmsgRqstHandler.resetResponse(); xmsgRqstHandler.appendResponse(response); xmsgRqstHandler.setCaughtException(true); } catch (Error e) { String response = CFGCashXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGCashXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n" + CFGCashXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); CFGCashXMsgRqstHandler xmsgRqstHandler = ((CFGCashXMsgRqstHandler) getParser()); xmsgRqstHandler.resetResponse(); xmsgRqstHandler.appendResponse(response); xmsgRqstHandler.setCaughtException(true); } }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccRam.CFAccRamDomainBaseTable.java
public CFAccCursor openDomainBaseCursorByTenantIdx(CFAccAuthorization Authorization, long TenantId) { CFAccCursor cursor;/*from w ww . ja v a2 s. c o m*/ CFAccDomainBaseByTenantIdxKey key = schema.getFactoryDomainBase().newTenantIdxKey(); key.setRequiredTenantId(TenantId); if (dictByTenantIdx.containsKey(key)) { SortedMap<CFAccDomainBasePKey, CFAccDomainBaseBuff> subdictTenantIdx = dictByTenantIdx.get(key); cursor = new CFAccRamDomainBaseCursor(Authorization, schema, subdictTenantIdx.values()); } else { cursor = new CFAccRamDomainBaseCursor(Authorization, schema, new ArrayList<CFAccDomainBaseBuff>()); } return (cursor); }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstRam.CFAstRamDomainBaseTable.java
public CFAstCursor openDomainBaseCursorByTenantIdx(CFAstAuthorization Authorization, long TenantId) { CFAstCursor cursor;/* ww w . java2 s .co m*/ CFAstDomainBaseByTenantIdxKey key = schema.getFactoryDomainBase().newTenantIdxKey(); key.setRequiredTenantId(TenantId); if (dictByTenantIdx.containsKey(key)) { SortedMap<CFAstDomainBasePKey, CFAstDomainBaseBuff> subdictTenantIdx = dictByTenantIdx.get(key); cursor = new CFAstRamDomainBaseCursor(Authorization, schema, subdictTenantIdx.values()); } else { cursor = new CFAstRamDomainBaseCursor(Authorization, schema, new ArrayList<CFAstDomainBaseBuff>()); } return (cursor); }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstXMsgRqstHandler.CFAstXMsgRqstAsteriskConfReadAllHandler.java
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { try {// w w w.ja v a 2 s .com // Common XML Attributes String attrId = null; // Attribute Extraction String attrLocalName; int numAttrs; int idxAttr; final String S_ProcName = "startElement"; final String S_LocalName = "LocalName"; assert qName.equals("RqstAsteriskConfReadAll"); CFAstXMsgRqstHandler xmsgRqstHandler = (CFAstXMsgRqstHandler) getParser(); if (xmsgRqstHandler == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "getParser()"); } ICFAstSchemaObj schemaObj = xmsgRqstHandler.getSchemaObj(); if (schemaObj == null) { throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 0, "getParser().getSchemaObj()"); } // 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 { throw CFLib.getDefaultExceptionFactory().newUnrecognizedAttributeException(getClass(), S_ProcName, getParser().getLocationInfo(), attrLocalName); } } // Save named attributes to context CFLibXmlCoreContext curContext = getParser().getCurContext(); // Read the objects and prepare the response XML SortedMap<CFAstConfigurationFilePKey, ICFAstAsteriskConfObj> map = schemaObj.getAsteriskConfTableObj() .readAllAsteriskConf(true); String responseOpening = CFAstXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFAstXMsgAsteriskConfMessageFormatter.formatAsteriskConfRspnListOpenTag(); xmsgRqstHandler.appendResponse(responseOpening); Iterator<ICFAstAsteriskConfObj> iter = map.values().iterator(); ICFAstAsteriskConfObj cur; String subxml; while (iter.hasNext()) { cur = iter.next(); subxml = CFAstXMsgAsteriskConfMessageFormatter.formatAsteriskConfRspnDerivedRec("\n\t\t", cur.getAsteriskConfBuff()); xmsgRqstHandler.appendResponse(subxml); } String responseClosing = "\n" + "\t" + CFAstXMsgAsteriskConfMessageFormatter.formatAsteriskConfRspnListCloseTag() + CFAstXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); xmsgRqstHandler.appendResponse(responseClosing); } catch (RuntimeException e) { String response = CFAstXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFAstXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n" + CFAstXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); CFAstXMsgRqstHandler xmsgRqstHandler = ((CFAstXMsgRqstHandler) getParser()); xmsgRqstHandler.resetResponse(); xmsgRqstHandler.appendResponse(response); xmsgRqstHandler.setCaughtException(true); } catch (Error e) { String response = CFAstXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFAstXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e) + "\n" + CFAstXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); CFAstXMsgRqstHandler xmsgRqstHandler = ((CFAstXMsgRqstHandler) getParser()); xmsgRqstHandler.resetResponse(); xmsgRqstHandler.appendResponse(response); xmsgRqstHandler.setCaughtException(true); } }
From source file:net.sourceforge.msscodefactory.cfcore.v2_0.CFGenKbXMsgRqstHandler.CFGenKbXMsgRqstGenFormatterReadAllHandler.java
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { try {//from w w w. j a v a2 s. co m // Common XML Attributes String attrId = null; // Attribute Extraction String attrLocalName; int numAttrs; int idxAttr; final String S_ProcName = "startElement"; final String S_LocalName = "LocalName"; assert qName.equals("RqstGenFormatterReadAll"); 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()"); } // 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 { throw CFLib.getDefaultExceptionFactory().newUnrecognizedAttributeException(getClass(), S_ProcName, getParser().getLocationInfo(), attrLocalName); } } // Save named attributes to context CFLibXmlCoreContext curContext = getParser().getCurContext(); // Read the objects and prepare the response XML SortedMap<CFGenKbGenItemPKey, ICFGenKbGenFormatterObj> map = schemaObj.getGenFormatterTableObj() .readAllGenFormatter(true); String responseOpening = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgGenFormatterMessageFormatter.formatGenFormatterRspnListOpenTag(); xmsgRqstHandler.appendResponse(responseOpening); Iterator<ICFGenKbGenFormatterObj> iter = map.values().iterator(); ICFGenKbGenFormatterObj cur; String subxml; while (iter.hasNext()) { cur = iter.next(); subxml = CFGenKbXMsgGenFormatterMessageFormatter.formatGenFormatterRspnDerivedRec("\n\t\t", cur.getGenFormatterBuff()); xmsgRqstHandler.appendResponse(subxml); } String responseClosing = "\n" + "\t" + CFGenKbXMsgGenFormatterMessageFormatter.formatGenFormatterRspnListCloseTag() + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); xmsgRqstHandler.appendResponse(responseClosing); } 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.CFGenKbXMsgRqstGenReferenceReadAllHandler.java
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { try {/*www . j a v a 2s . co m*/ // Common XML Attributes String attrId = null; // Attribute Extraction String attrLocalName; int numAttrs; int idxAttr; final String S_ProcName = "startElement"; final String S_LocalName = "LocalName"; assert qName.equals("RqstGenReferenceReadAll"); 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()"); } // 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 { throw CFLib.getDefaultExceptionFactory().newUnrecognizedAttributeException(getClass(), S_ProcName, getParser().getLocationInfo(), attrLocalName); } } // Save named attributes to context CFLibXmlCoreContext curContext = getParser().getCurContext(); // Read the objects and prepare the response XML SortedMap<CFGenKbGenItemPKey, ICFGenKbGenReferenceObj> map = schemaObj.getGenReferenceTableObj() .readAllGenReference(true); String responseOpening = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgGenReferenceMessageFormatter.formatGenReferenceRspnListOpenTag(); xmsgRqstHandler.appendResponse(responseOpening); Iterator<ICFGenKbGenReferenceObj> iter = map.values().iterator(); ICFGenKbGenReferenceObj cur; String subxml; while (iter.hasNext()) { cur = iter.next(); subxml = CFGenKbXMsgGenReferenceMessageFormatter.formatGenReferenceRspnDerivedRec("\n\t\t", cur.getGenReferenceBuff()); xmsgRqstHandler.appendResponse(subxml); } String responseClosing = "\n" + "\t" + CFGenKbXMsgGenReferenceMessageFormatter.formatGenReferenceRspnListCloseTag() + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); xmsgRqstHandler.appendResponse(responseClosing); } 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.CFGenKbXMsgRqstGelIteratorReadAllHandler.java
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { try {/*w w w. ja va 2 s .c o m*/ // Common XML Attributes String attrId = null; // Attribute Extraction String attrLocalName; int numAttrs; int idxAttr; final String S_ProcName = "startElement"; final String S_LocalName = "LocalName"; assert qName.equals("RqstGelIteratorReadAll"); 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()"); } // 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 { throw CFLib.getDefaultExceptionFactory().newUnrecognizedAttributeException(getClass(), S_ProcName, getParser().getLocationInfo(), attrLocalName); } } // Save named attributes to context CFLibXmlCoreContext curContext = getParser().getCurContext(); // Read the objects and prepare the response XML SortedMap<CFGenKbGelInstructionPKey, ICFGenKbGelIteratorObj> map = schemaObj.getGelIteratorTableObj() .readAllGelIterator(true); String responseOpening = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgGelIteratorMessageFormatter.formatGelIteratorRspnListOpenTag(); xmsgRqstHandler.appendResponse(responseOpening); Iterator<ICFGenKbGelIteratorObj> iter = map.values().iterator(); ICFGenKbGelIteratorObj cur; String subxml; while (iter.hasNext()) { cur = iter.next(); subxml = CFGenKbXMsgGelIteratorMessageFormatter.formatGelIteratorRspnDerivedRec("\n\t\t", cur.getGelIteratorBuff()); xmsgRqstHandler.appendResponse(subxml); } String responseClosing = "\n" + "\t" + CFGenKbXMsgGelIteratorMessageFormatter.formatGelIteratorRspnListCloseTag() + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); xmsgRqstHandler.appendResponse(responseClosing); } 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.CFGenKbXMsgRqstGelModifierReadAllHandler.java
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { try {/* w ww . j av a2 s . c o m*/ // Common XML Attributes String attrId = null; // Attribute Extraction String attrLocalName; int numAttrs; int idxAttr; final String S_ProcName = "startElement"; final String S_LocalName = "LocalName"; assert qName.equals("RqstGelModifierReadAll"); 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()"); } // 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 { throw CFLib.getDefaultExceptionFactory().newUnrecognizedAttributeException(getClass(), S_ProcName, getParser().getLocationInfo(), attrLocalName); } } // Save named attributes to context CFLibXmlCoreContext curContext = getParser().getCurContext(); // Read the objects and prepare the response XML SortedMap<CFGenKbGelInstructionPKey, ICFGenKbGelModifierObj> map = schemaObj.getGelModifierTableObj() .readAllGelModifier(true); String responseOpening = CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPreamble() + "\n" + "\t" + CFGenKbXMsgGelModifierMessageFormatter.formatGelModifierRspnListOpenTag(); xmsgRqstHandler.appendResponse(responseOpening); Iterator<ICFGenKbGelModifierObj> iter = map.values().iterator(); ICFGenKbGelModifierObj cur; String subxml; while (iter.hasNext()) { cur = iter.next(); subxml = CFGenKbXMsgGelModifierMessageFormatter.formatGelModifierRspnDerivedRec("\n\t\t", cur.getGelModifierBuff()); xmsgRqstHandler.appendResponse(subxml); } String responseClosing = "\n" + "\t" + CFGenKbXMsgGelModifierMessageFormatter.formatGelModifierRspnListCloseTag() + CFGenKbXMsgSchemaMessageFormatter.formatRspnXmlPostamble(); xmsgRqstHandler.appendResponse(responseClosing); } 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); } }