Java tutorial
// Description: Java 7 XML SAX Parser for CFAcc. /* * MSS Code Factory Accounting Business Application Model * * Copyright (c) 2014 Mark Sobkow * * This program is available as free software under the GNU GPL v3, or * under a commercial license from Mark Sobkow. For commercial licensing * details, please contact msobkow@sasktel.net. * * Under the terms of the GPL: * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * This source code incorporates modified modules originally licensed * under the Apache 2.0 license by MSS Code Factory including CFSecurity * (net-sourceforge-msscodefactory-2.0-cfsecurity.xml), * CFInternet (net-sourceforge-msscodefactory-2.0-cfinternet.xml), and * CFCrm 2.0 (net-sourceforge-msscodefactory-2.0-cfcrm.xml), with all of the * required models being available as part of the MSS Code Factory 1.11 * distribution source and install zips. * * You can download installations of MSS Code Factory 1.11 from * http://msscodefactory.sourceforge.net/ * * *********************************************************************** * * Code manufactured by MSS Code Factory */ package net.sourceforge.msscodefactory.cfacc.v2_0.CFAccSaxLoader; import java.io.File; import java.lang.reflect.*; import java.math.*; import java.net.URL; import java.sql.*; import java.text.*; import java.util.*; import javax.naming.*; import javax.sql.*; import net.sourceforge.msscodefactory.cflib.v1_11.CFLib.*; import org.apache.commons.codec.binary.Base64; import org.xml.sax.*; import net.sourceforge.msscodefactory.cfacc.v2_0.CFAcc.*; import net.sourceforge.msscodefactory.cfacc.v2_0.CFAccObj.*; public class CFAccSaxLoader extends CFLibXmlCoreSaxParser implements ContentHandler { // The namespace URI of the supported schema public final static String SCHEMA_XMLNS = "uri://net.sourceforge.msscodefactory.cfacc.v2_0/cfaccloader"; // The source for loading the supported schema public final static String SCHEMA_URI = "xsd/cfacc-20-structured.xsd"; public final static String SCHEMA_ROOT_URI = "/xsd/cfacc-20-structured.xsd"; public final static String CFSECURITY_XMLNS = "uri://net.sourceforge.msscodefactory.cfacc.v2_0/cfsecurityloader"; public final static String CFSECURITY_URI = "xsd/cfsecurity-20-structured.xsd"; public final static String CFSECURITY_ROOT_URI = "xsd/cfsecurity-20-structured.xsd"; public final static String CFINTERNET_XMLNS = "uri://net.sourceforge.msscodefactory.cfacc.v2_0/cfinternetloader"; public final static String CFINTERNET_URI = "xsd/cfinternet-20-structured.xsd"; public final static String CFINTERNET_ROOT_URI = "xsd/cfinternet-20-structured.xsd"; public final static String CFCRM_XMLNS = "uri://net.sourceforge.msscodefactory.cfacc.v2_0/cfcrmloader"; public final static String CFCRM_URI = "xsd/cfcrm-20-structured.xsd"; public final static String CFCRM_ROOT_URI = "xsd/cfcrm-20-structured.xsd"; // The schema instance to load in to private ICFAccSchemaObj schemaObj = null; // Loader behaviour configuration attributes public enum LoaderBehaviourEnum { Insert, Update, Replace }; private LoaderBehaviourEnum accountLoaderBehaviour = LoaderBehaviourEnum.Insert; private LoaderBehaviourEnum accountConfigLoaderBehaviour = LoaderBehaviourEnum.Insert; private LoaderBehaviourEnum accountContactLoaderBehaviour = LoaderBehaviourEnum.Insert; private LoaderBehaviourEnum accountEntryLoaderBehaviour = LoaderBehaviourEnum.Insert; private LoaderBehaviourEnum addressLoaderBehaviour = LoaderBehaviourEnum.Update; private LoaderBehaviourEnum addressTagLoaderBehaviour = LoaderBehaviourEnum.Update; private LoaderBehaviourEnum attachmentLoaderBehaviour = LoaderBehaviourEnum.Update; private LoaderBehaviourEnum attachmentTagLoaderBehaviour = LoaderBehaviourEnum.Update; private LoaderBehaviourEnum auditActionLoaderBehaviour = LoaderBehaviourEnum.Insert; private LoaderBehaviourEnum clusterLoaderBehaviour = LoaderBehaviourEnum.Insert; private LoaderBehaviourEnum contactLoaderBehaviour = LoaderBehaviourEnum.Update; private LoaderBehaviourEnum contactListLoaderBehaviour = LoaderBehaviourEnum.Update; private LoaderBehaviourEnum contactTagLoaderBehaviour = LoaderBehaviourEnum.Update; private LoaderBehaviourEnum contactURLLoaderBehaviour = LoaderBehaviourEnum.Update; private LoaderBehaviourEnum domainLoaderBehaviour = LoaderBehaviourEnum.Update; private LoaderBehaviourEnum domainBaseLoaderBehaviour = LoaderBehaviourEnum.Update; private LoaderBehaviourEnum hostNodeLoaderBehaviour = LoaderBehaviourEnum.Update; private LoaderBehaviourEnum iSOCountryLoaderBehaviour = LoaderBehaviourEnum.Update; private LoaderBehaviourEnum iSOCountryCurrencyLoaderBehaviour = LoaderBehaviourEnum.Insert; private LoaderBehaviourEnum iSOCountryLanguageLoaderBehaviour = LoaderBehaviourEnum.Insert; private LoaderBehaviourEnum iSOCurrencyLoaderBehaviour = LoaderBehaviourEnum.Update; private LoaderBehaviourEnum iSOLanguageLoaderBehaviour = LoaderBehaviourEnum.Update; private LoaderBehaviourEnum iSOTimezoneLoaderBehaviour = LoaderBehaviourEnum.Update; private LoaderBehaviourEnum majorVersionLoaderBehaviour = LoaderBehaviourEnum.Update; private LoaderBehaviourEnum memoLoaderBehaviour = LoaderBehaviourEnum.Update; private LoaderBehaviourEnum memoTagLoaderBehaviour = LoaderBehaviourEnum.Update; private LoaderBehaviourEnum mimeTypeLoaderBehaviour = LoaderBehaviourEnum.Update; private LoaderBehaviourEnum minorVersionLoaderBehaviour = LoaderBehaviourEnum.Update; private LoaderBehaviourEnum phoneLoaderBehaviour = LoaderBehaviourEnum.Update; private LoaderBehaviourEnum phoneTagLoaderBehaviour = LoaderBehaviourEnum.Update; private LoaderBehaviourEnum projectBaseLoaderBehaviour = LoaderBehaviourEnum.Update; private LoaderBehaviourEnum realProjectLoaderBehaviour = LoaderBehaviourEnum.Update; private LoaderBehaviourEnum secAppLoaderBehaviour = LoaderBehaviourEnum.Update; private LoaderBehaviourEnum secFormLoaderBehaviour = LoaderBehaviourEnum.Update; private LoaderBehaviourEnum secGroupLoaderBehaviour = LoaderBehaviourEnum.Insert; private LoaderBehaviourEnum secGroupFormLoaderBehaviour = LoaderBehaviourEnum.Insert; private LoaderBehaviourEnum secGroupIncludeLoaderBehaviour = LoaderBehaviourEnum.Insert; private LoaderBehaviourEnum secGroupMemberLoaderBehaviour = LoaderBehaviourEnum.Insert; private LoaderBehaviourEnum secSessionLoaderBehaviour = LoaderBehaviourEnum.Insert; private LoaderBehaviourEnum secUserLoaderBehaviour = LoaderBehaviourEnum.Insert; private LoaderBehaviourEnum serviceLoaderBehaviour = LoaderBehaviourEnum.Update; private LoaderBehaviourEnum serviceTypeLoaderBehaviour = LoaderBehaviourEnum.Insert; private LoaderBehaviourEnum subProjectLoaderBehaviour = LoaderBehaviourEnum.Update; private LoaderBehaviourEnum tSecGroupLoaderBehaviour = LoaderBehaviourEnum.Insert; private LoaderBehaviourEnum tSecGroupIncludeLoaderBehaviour = LoaderBehaviourEnum.Insert; private LoaderBehaviourEnum tSecGroupMemberLoaderBehaviour = LoaderBehaviourEnum.Insert; private LoaderBehaviourEnum tagLoaderBehaviour = LoaderBehaviourEnum.Insert; private LoaderBehaviourEnum tenantLoaderBehaviour = LoaderBehaviourEnum.Insert; private LoaderBehaviourEnum tldLoaderBehaviour = LoaderBehaviourEnum.Update; private LoaderBehaviourEnum topDomainLoaderBehaviour = LoaderBehaviourEnum.Update; private LoaderBehaviourEnum topProjectLoaderBehaviour = LoaderBehaviourEnum.Update; private LoaderBehaviourEnum uRLProtocolLoaderBehaviour = LoaderBehaviourEnum.Update; private LoaderBehaviourEnum versionLoaderBehaviour = LoaderBehaviourEnum.Update; // Constructors public CFAccSaxLoader() { super(); setRootElementHandler(getSaxRootHandler()); File file = new File(SCHEMA_URI); if (file.exists()) { addSchema(SCHEMA_URI); } else { URL url = getClass().getResource(SCHEMA_ROOT_URI); if (url != null) { addSchema(url.toString()); } } file = new File(CFSECURITY_URI); if (file.exists()) { addSchema(CFSECURITY_URI); } else { URL url = getClass().getResource(CFSECURITY_ROOT_URI); if (url != null) { addSchema(url.toString()); } } file = new File(CFINTERNET_URI); if (file.exists()) { addSchema(CFINTERNET_URI); } else { URL url = getClass().getResource(CFINTERNET_ROOT_URI); if (url != null) { addSchema(url.toString()); } } file = new File(CFCRM_URI); if (file.exists()) { addSchema(CFCRM_URI); } else { URL url = getClass().getResource(CFCRM_ROOT_URI); if (url != null) { addSchema(url.toString()); } } initParser(); } public CFAccSaxLoader(ICFLibMessageLog logger) { super(logger); setRootElementHandler(getSaxRootHandler()); File file = new File(SCHEMA_URI); if (file.exists()) { addSchema(SCHEMA_URI); } else { URL url = getClass().getResource(SCHEMA_ROOT_URI); if (url != null) { addSchema(url.toString()); } } file = new File(CFSECURITY_URI); if (file.exists()) { addSchema(CFSECURITY_URI); } else { URL url = getClass().getResource(CFSECURITY_ROOT_URI); if (url != null) { addSchema(url.toString()); } } file = new File(CFINTERNET_URI); if (file.exists()) { addSchema(CFINTERNET_URI); } else { URL url = getClass().getResource(CFINTERNET_ROOT_URI); if (url != null) { addSchema(url.toString()); } } file = new File(CFCRM_URI); if (file.exists()) { addSchema(CFCRM_URI); } else { URL url = getClass().getResource(CFCRM_ROOT_URI); if (url != null) { addSchema(url.toString()); } } initParser(); } // Element Handler instances private CFAccSaxLoaderAccountHandler accountHandler = null; private CFAccSaxLoaderAccountConfigHandler accountConfigHandler = null; private CFAccSaxLoaderAccountContactHandler accountContactHandler = null; private CFAccSaxLoaderAccountEntryHandler accountEntryHandler = null; private CFAccSaxLoaderAddressHandler addressHandler = null; private CFAccSaxLoaderAddressTagHandler addressTagHandler = null; private CFAccSaxLoaderAttachmentHandler attachmentHandler = null; private CFAccSaxLoaderAttachmentTagHandler attachmentTagHandler = null; private CFAccSaxLoaderAuditActionHandler auditActionHandler = null; private CFAccSaxLoaderClusterHandler clusterHandler = null; private CFAccSaxLoaderContactHandler contactHandler = null; private CFAccSaxLoaderContactListHandler contactListHandler = null; private CFAccSaxLoaderContactTagHandler contactTagHandler = null; private CFAccSaxLoaderContactURLHandler contactURLHandler = null; private CFAccSaxLoaderDomainHandler domainHandler = null; private CFAccSaxLoaderDomainBaseHandler domainBaseHandler = null; private CFAccSaxLoaderHostNodeHandler hostNodeHandler = null; private CFAccSaxLoaderISOCountryHandler iSOCountryHandler = null; private CFAccSaxLoaderISOCountryCurrencyHandler iSOCountryCurrencyHandler = null; private CFAccSaxLoaderISOCountryLanguageHandler iSOCountryLanguageHandler = null; private CFAccSaxLoaderISOCurrencyHandler iSOCurrencyHandler = null; private CFAccSaxLoaderISOLanguageHandler iSOLanguageHandler = null; private CFAccSaxLoaderISOTimezoneHandler iSOTimezoneHandler = null; private CFAccSaxLoaderMajorVersionHandler majorVersionHandler = null; private CFAccSaxLoaderMemoHandler memoHandler = null; private CFAccSaxLoaderMemoTagHandler memoTagHandler = null; private CFAccSaxLoaderMimeTypeHandler mimeTypeHandler = null; private CFAccSaxLoaderMinorVersionHandler minorVersionHandler = null; private CFAccSaxLoaderPhoneHandler phoneHandler = null; private CFAccSaxLoaderPhoneTagHandler phoneTagHandler = null; private CFAccSaxLoaderProjectBaseHandler projectBaseHandler = null; private CFAccSaxLoaderRealProjectHandler realProjectHandler = null; private CFAccSaxLoaderSecAppHandler secAppHandler = null; private CFAccSaxLoaderSecFormHandler secFormHandler = null; private CFAccSaxLoaderSecGroupHandler secGroupHandler = null; private CFAccSaxLoaderSecGroupFormHandler secGroupFormHandler = null; private CFAccSaxLoaderSecGroupIncludeHandler secGroupIncludeHandler = null; private CFAccSaxLoaderSecGroupMemberHandler secGroupMemberHandler = null; private CFAccSaxLoaderSecSessionHandler secSessionHandler = null; private CFAccSaxLoaderSecUserHandler secUserHandler = null; private CFAccSaxLoaderServiceHandler serviceHandler = null; private CFAccSaxLoaderServiceTypeHandler serviceTypeHandler = null; private CFAccSaxLoaderSubProjectHandler subProjectHandler = null; private CFAccSaxLoaderTSecGroupHandler tSecGroupHandler = null; private CFAccSaxLoaderTSecGroupIncludeHandler tSecGroupIncludeHandler = null; private CFAccSaxLoaderTSecGroupMemberHandler tSecGroupMemberHandler = null; private CFAccSaxLoaderTagHandler tagHandler = null; private CFAccSaxLoaderTenantHandler tenantHandler = null; private CFAccSaxLoaderTldHandler tldHandler = null; private CFAccSaxLoaderTopDomainHandler topDomainHandler = null; private CFAccSaxLoaderTopProjectHandler topProjectHandler = null; private CFAccSaxLoaderURLProtocolHandler uRLProtocolHandler = null; private CFAccSaxLoaderVersionHandler versionHandler = null; private CFAccSaxRootHandler saxRootHandler = null; private CFAccSaxDocHandler saxDocHandler = null; // Schema object accessors // SchemaObj accessors public ICFAccSchemaObj getSchemaObj() { return (schemaObj); } public void setSchemaObj(ICFAccSchemaObj value) { schemaObj = value; } // Element Handler Resolver Factories protected CFAccSaxLoaderAccountHandler getAccountHandler() { if (accountHandler == null) { accountHandler = new CFAccSaxLoaderAccountHandler(this); accountHandler.addElementHandler("AccountContact", getAccountContactHandler()); accountHandler.addElementHandler("AccountEntry", getAccountEntryHandler()); } return (accountHandler); } protected CFAccSaxLoaderAccountConfigHandler getAccountConfigHandler() { if (accountConfigHandler == null) { accountConfigHandler = new CFAccSaxLoaderAccountConfigHandler(this); } return (accountConfigHandler); } protected CFAccSaxLoaderAccountContactHandler getAccountContactHandler() { if (accountContactHandler == null) { accountContactHandler = new CFAccSaxLoaderAccountContactHandler(this); } return (accountContactHandler); } protected CFAccSaxLoaderAccountEntryHandler getAccountEntryHandler() { if (accountEntryHandler == null) { accountEntryHandler = new CFAccSaxLoaderAccountEntryHandler(this); } return (accountEntryHandler); } protected CFAccSaxLoaderAddressHandler getAddressHandler() { if (addressHandler == null) { addressHandler = new CFAccSaxLoaderAddressHandler(this); addressHandler.addElementHandler("AddressTag", getAddressTagHandler()); } return (addressHandler); } protected CFAccSaxLoaderAddressTagHandler getAddressTagHandler() { if (addressTagHandler == null) { addressTagHandler = new CFAccSaxLoaderAddressTagHandler(this); } return (addressTagHandler); } protected CFAccSaxLoaderAttachmentHandler getAttachmentHandler() { if (attachmentHandler == null) { attachmentHandler = new CFAccSaxLoaderAttachmentHandler(this); attachmentHandler.addElementHandler("AttachmentTag", getAttachmentTagHandler()); } return (attachmentHandler); } protected CFAccSaxLoaderAttachmentTagHandler getAttachmentTagHandler() { if (attachmentTagHandler == null) { attachmentTagHandler = new CFAccSaxLoaderAttachmentTagHandler(this); } return (attachmentTagHandler); } protected CFAccSaxLoaderAuditActionHandler getAuditActionHandler() { if (auditActionHandler == null) { auditActionHandler = new CFAccSaxLoaderAuditActionHandler(this); } return (auditActionHandler); } protected CFAccSaxLoaderClusterHandler getClusterHandler() { if (clusterHandler == null) { clusterHandler = new CFAccSaxLoaderClusterHandler(this); clusterHandler.addElementHandler("HostNode", getHostNodeHandler()); clusterHandler.addElementHandler("Tenant", getTenantHandler()); clusterHandler.addElementHandler("SecApp", getSecAppHandler()); clusterHandler.addElementHandler("SecGroup", getSecGroupHandler()); } return (clusterHandler); } protected CFAccSaxLoaderContactHandler getContactHandler() { if (contactHandler == null) { contactHandler = new CFAccSaxLoaderContactHandler(this); contactHandler.addElementHandler("ContactTag", getContactTagHandler()); contactHandler.addElementHandler("Address", getAddressHandler()); contactHandler.addElementHandler("Phone", getPhoneHandler()); contactHandler.addElementHandler("ContactURL", getContactURLHandler()); contactHandler.addElementHandler("Memo", getMemoHandler()); } return (contactHandler); } protected CFAccSaxLoaderContactListHandler getContactListHandler() { if (contactListHandler == null) { contactListHandler = new CFAccSaxLoaderContactListHandler(this); contactListHandler.addElementHandler("Contact", getContactHandler()); } return (contactListHandler); } protected CFAccSaxLoaderContactTagHandler getContactTagHandler() { if (contactTagHandler == null) { contactTagHandler = new CFAccSaxLoaderContactTagHandler(this); } return (contactTagHandler); } protected CFAccSaxLoaderContactURLHandler getContactURLHandler() { if (contactURLHandler == null) { contactURLHandler = new CFAccSaxLoaderContactURLHandler(this); } return (contactURLHandler); } protected CFAccSaxLoaderDomainHandler getDomainHandler() { if (domainHandler == null) { domainHandler = new CFAccSaxLoaderDomainHandler(this); domainHandler.addElementHandler("TopProject", getTopProjectHandler()); } return (domainHandler); } protected CFAccSaxLoaderDomainBaseHandler getDomainBaseHandler() { if (domainBaseHandler == null) { domainBaseHandler = new CFAccSaxLoaderDomainBaseHandler(this); } return (domainBaseHandler); } protected CFAccSaxLoaderHostNodeHandler getHostNodeHandler() { if (hostNodeHandler == null) { hostNodeHandler = new CFAccSaxLoaderHostNodeHandler(this); hostNodeHandler.addElementHandler("Service", getServiceHandler()); } return (hostNodeHandler); } protected CFAccSaxLoaderISOCountryHandler getISOCountryHandler() { if (iSOCountryHandler == null) { iSOCountryHandler = new CFAccSaxLoaderISOCountryHandler(this); iSOCountryHandler.addElementHandler("ISOCountryCurrency", getISOCountryCurrencyHandler()); iSOCountryHandler.addElementHandler("ISOCountryLanguage", getISOCountryLanguageHandler()); } return (iSOCountryHandler); } protected CFAccSaxLoaderISOCountryCurrencyHandler getISOCountryCurrencyHandler() { if (iSOCountryCurrencyHandler == null) { iSOCountryCurrencyHandler = new CFAccSaxLoaderISOCountryCurrencyHandler(this); } return (iSOCountryCurrencyHandler); } protected CFAccSaxLoaderISOCountryLanguageHandler getISOCountryLanguageHandler() { if (iSOCountryLanguageHandler == null) { iSOCountryLanguageHandler = new CFAccSaxLoaderISOCountryLanguageHandler(this); } return (iSOCountryLanguageHandler); } protected CFAccSaxLoaderISOCurrencyHandler getISOCurrencyHandler() { if (iSOCurrencyHandler == null) { iSOCurrencyHandler = new CFAccSaxLoaderISOCurrencyHandler(this); } return (iSOCurrencyHandler); } protected CFAccSaxLoaderISOLanguageHandler getISOLanguageHandler() { if (iSOLanguageHandler == null) { iSOLanguageHandler = new CFAccSaxLoaderISOLanguageHandler(this); } return (iSOLanguageHandler); } protected CFAccSaxLoaderISOTimezoneHandler getISOTimezoneHandler() { if (iSOTimezoneHandler == null) { iSOTimezoneHandler = new CFAccSaxLoaderISOTimezoneHandler(this); } return (iSOTimezoneHandler); } protected CFAccSaxLoaderMajorVersionHandler getMajorVersionHandler() { if (majorVersionHandler == null) { majorVersionHandler = new CFAccSaxLoaderMajorVersionHandler(this); majorVersionHandler.addElementHandler("MinorVersion", getMinorVersionHandler()); } return (majorVersionHandler); } protected CFAccSaxLoaderMemoHandler getMemoHandler() { if (memoHandler == null) { memoHandler = new CFAccSaxLoaderMemoHandler(this); memoHandler.addElementHandler("MemoTag", getMemoTagHandler()); } return (memoHandler); } protected CFAccSaxLoaderMemoTagHandler getMemoTagHandler() { if (memoTagHandler == null) { memoTagHandler = new CFAccSaxLoaderMemoTagHandler(this); } return (memoTagHandler); } protected CFAccSaxLoaderMimeTypeHandler getMimeTypeHandler() { if (mimeTypeHandler == null) { mimeTypeHandler = new CFAccSaxLoaderMimeTypeHandler(this); } return (mimeTypeHandler); } protected CFAccSaxLoaderMinorVersionHandler getMinorVersionHandler() { if (minorVersionHandler == null) { minorVersionHandler = new CFAccSaxLoaderMinorVersionHandler(this); } return (minorVersionHandler); } protected CFAccSaxLoaderPhoneHandler getPhoneHandler() { if (phoneHandler == null) { phoneHandler = new CFAccSaxLoaderPhoneHandler(this); phoneHandler.addElementHandler("PhoneTag", getPhoneTagHandler()); } return (phoneHandler); } protected CFAccSaxLoaderPhoneTagHandler getPhoneTagHandler() { if (phoneTagHandler == null) { phoneTagHandler = new CFAccSaxLoaderPhoneTagHandler(this); } return (phoneTagHandler); } protected CFAccSaxLoaderProjectBaseHandler getProjectBaseHandler() { if (projectBaseHandler == null) { projectBaseHandler = new CFAccSaxLoaderProjectBaseHandler(this); } return (projectBaseHandler); } protected CFAccSaxLoaderRealProjectHandler getRealProjectHandler() { if (realProjectHandler == null) { realProjectHandler = new CFAccSaxLoaderRealProjectHandler(this); realProjectHandler.addElementHandler("MajorVersion", getMajorVersionHandler()); } return (realProjectHandler); } protected CFAccSaxLoaderSecAppHandler getSecAppHandler() { if (secAppHandler == null) { secAppHandler = new CFAccSaxLoaderSecAppHandler(this); secAppHandler.addElementHandler("SecForm", getSecFormHandler()); } return (secAppHandler); } protected CFAccSaxLoaderSecFormHandler getSecFormHandler() { if (secFormHandler == null) { secFormHandler = new CFAccSaxLoaderSecFormHandler(this); } return (secFormHandler); } protected CFAccSaxLoaderSecGroupHandler getSecGroupHandler() { if (secGroupHandler == null) { secGroupHandler = new CFAccSaxLoaderSecGroupHandler(this); secGroupHandler.addElementHandler("SecGroupInclude", getSecGroupIncludeHandler()); secGroupHandler.addElementHandler("SecGroupMember", getSecGroupMemberHandler()); secGroupHandler.addElementHandler("SecGroupForm", getSecGroupFormHandler()); } return (secGroupHandler); } protected CFAccSaxLoaderSecGroupFormHandler getSecGroupFormHandler() { if (secGroupFormHandler == null) { secGroupFormHandler = new CFAccSaxLoaderSecGroupFormHandler(this); } return (secGroupFormHandler); } protected CFAccSaxLoaderSecGroupIncludeHandler getSecGroupIncludeHandler() { if (secGroupIncludeHandler == null) { secGroupIncludeHandler = new CFAccSaxLoaderSecGroupIncludeHandler(this); } return (secGroupIncludeHandler); } protected CFAccSaxLoaderSecGroupMemberHandler getSecGroupMemberHandler() { if (secGroupMemberHandler == null) { secGroupMemberHandler = new CFAccSaxLoaderSecGroupMemberHandler(this); } return (secGroupMemberHandler); } protected CFAccSaxLoaderSecSessionHandler getSecSessionHandler() { if (secSessionHandler == null) { secSessionHandler = new CFAccSaxLoaderSecSessionHandler(this); } return (secSessionHandler); } protected CFAccSaxLoaderSecUserHandler getSecUserHandler() { if (secUserHandler == null) { secUserHandler = new CFAccSaxLoaderSecUserHandler(this); secUserHandler.addElementHandler("SecSession", getSecSessionHandler()); } return (secUserHandler); } protected CFAccSaxLoaderServiceHandler getServiceHandler() { if (serviceHandler == null) { serviceHandler = new CFAccSaxLoaderServiceHandler(this); } return (serviceHandler); } protected CFAccSaxLoaderServiceTypeHandler getServiceTypeHandler() { if (serviceTypeHandler == null) { serviceTypeHandler = new CFAccSaxLoaderServiceTypeHandler(this); } return (serviceTypeHandler); } protected CFAccSaxLoaderSubProjectHandler getSubProjectHandler() { if (subProjectHandler == null) { subProjectHandler = new CFAccSaxLoaderSubProjectHandler(this); subProjectHandler.addElementHandler("MajorVersion", getMajorVersionHandler()); } return (subProjectHandler); } protected CFAccSaxLoaderTSecGroupHandler getTSecGroupHandler() { if (tSecGroupHandler == null) { tSecGroupHandler = new CFAccSaxLoaderTSecGroupHandler(this); tSecGroupHandler.addElementHandler("TSecGroupInclude", getTSecGroupIncludeHandler()); tSecGroupHandler.addElementHandler("TSecGroupMember", getTSecGroupMemberHandler()); } return (tSecGroupHandler); } protected CFAccSaxLoaderTSecGroupIncludeHandler getTSecGroupIncludeHandler() { if (tSecGroupIncludeHandler == null) { tSecGroupIncludeHandler = new CFAccSaxLoaderTSecGroupIncludeHandler(this); } return (tSecGroupIncludeHandler); } protected CFAccSaxLoaderTSecGroupMemberHandler getTSecGroupMemberHandler() { if (tSecGroupMemberHandler == null) { tSecGroupMemberHandler = new CFAccSaxLoaderTSecGroupMemberHandler(this); } return (tSecGroupMemberHandler); } protected CFAccSaxLoaderTagHandler getTagHandler() { if (tagHandler == null) { tagHandler = new CFAccSaxLoaderTagHandler(this); } return (tagHandler); } protected CFAccSaxLoaderTenantHandler getTenantHandler() { if (tenantHandler == null) { tenantHandler = new CFAccSaxLoaderTenantHandler(this); tenantHandler.addElementHandler("TSecGroup", getTSecGroupHandler()); tenantHandler.addElementHandler("Tld", getTldHandler()); tenantHandler.addElementHandler("ContactList", getContactListHandler()); tenantHandler.addElementHandler("Tag", getTagHandler()); tenantHandler.addElementHandler("AccountConfig", getAccountConfigHandler()); tenantHandler.addElementHandler("Account", getAccountHandler()); } return (tenantHandler); } protected CFAccSaxLoaderTldHandler getTldHandler() { if (tldHandler == null) { tldHandler = new CFAccSaxLoaderTldHandler(this); tldHandler.addElementHandler("TopDomain", getTopDomainHandler()); } return (tldHandler); } protected CFAccSaxLoaderTopDomainHandler getTopDomainHandler() { if (topDomainHandler == null) { topDomainHandler = new CFAccSaxLoaderTopDomainHandler(this); topDomainHandler.addElementHandler("Domain", getDomainHandler()); topDomainHandler.addElementHandler("TopProject", getTopProjectHandler()); } return (topDomainHandler); } protected CFAccSaxLoaderTopProjectHandler getTopProjectHandler() { if (topProjectHandler == null) { topProjectHandler = new CFAccSaxLoaderTopProjectHandler(this); topProjectHandler.addElementHandler("MajorVersion", getMajorVersionHandler()); topProjectHandler.addElementHandler("SubProject", getSubProjectHandler()); } return (topProjectHandler); } protected CFAccSaxLoaderURLProtocolHandler getURLProtocolHandler() { if (uRLProtocolHandler == null) { uRLProtocolHandler = new CFAccSaxLoaderURLProtocolHandler(this); } return (uRLProtocolHandler); } protected CFAccSaxLoaderVersionHandler getVersionHandler() { if (versionHandler == null) { versionHandler = new CFAccSaxLoaderVersionHandler(this); } return (versionHandler); } // Root Element Handler Resolver Factory protected CFAccSaxRootHandler getSaxRootHandler() { if (saxRootHandler == null) { saxRootHandler = new CFAccSaxRootHandler(this); saxRootHandler.addElementHandler("CFAcc", getSaxDocHandler()); saxRootHandler.addElementHandler("CFSecurity", getSaxDocHandler()); saxRootHandler.addElementHandler("CFInternet", getSaxDocHandler()); saxRootHandler.addElementHandler("CFCrm", getSaxDocHandler()); } return (saxRootHandler); } // Root Element Handler /* * CFAccSaxRootHandler XML SAX Root Element Handler implementation */ public class CFAccSaxRootHandler extends CFLibXmlCoreElementHandler { public CFAccSaxRootHandler(CFAccSaxLoader saxLoader) { super(saxLoader); } public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { } public void endElement(String uri, String localName, String qName) throws SAXException { } } // Document Element Handler Resolver Factory protected CFAccSaxDocHandler getSaxDocHandler() { if (saxDocHandler == null) { saxDocHandler = new CFAccSaxDocHandler(this); saxDocHandler.addElementHandler("AuditAction", getAuditActionHandler()); saxDocHandler.addElementHandler("Cluster", getClusterHandler()); saxDocHandler.addElementHandler("ISOCountry", getISOCountryHandler()); saxDocHandler.addElementHandler("ISOCurrency", getISOCurrencyHandler()); saxDocHandler.addElementHandler("ISOLanguage", getISOLanguageHandler()); saxDocHandler.addElementHandler("ISOTimezone", getISOTimezoneHandler()); saxDocHandler.addElementHandler("MimeType", getMimeTypeHandler()); saxDocHandler.addElementHandler("SecUser", getSecUserHandler()); saxDocHandler.addElementHandler("ServiceType", getServiceTypeHandler()); saxDocHandler.addElementHandler("URLProtocol", getURLProtocolHandler()); } return (saxDocHandler); } // Document Element Handler /* * CFAccSaxDocHandler XML SAX Doc Element Handler implementation */ public class CFAccSaxDocHandler extends CFLibXmlCoreElementHandler { public CFAccSaxDocHandler(CFAccSaxLoader saxLoader) { super(saxLoader); } public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { } public void endElement(String uri, String localName, String qName) throws SAXException { } } // Loader behaviour configuration accessors public LoaderBehaviourEnum getAccountLoaderBehaviour() { return (accountLoaderBehaviour); } public void setAccountLoaderBehaviour(LoaderBehaviourEnum value) { accountLoaderBehaviour = value; } public LoaderBehaviourEnum getAccountConfigLoaderBehaviour() { return (accountConfigLoaderBehaviour); } public void setAccountConfigLoaderBehaviour(LoaderBehaviourEnum value) { accountConfigLoaderBehaviour = value; } public LoaderBehaviourEnum getAccountContactLoaderBehaviour() { return (accountContactLoaderBehaviour); } public void setAccountContactLoaderBehaviour(LoaderBehaviourEnum value) { accountContactLoaderBehaviour = value; } public LoaderBehaviourEnum getAccountEntryLoaderBehaviour() { return (accountEntryLoaderBehaviour); } public void setAccountEntryLoaderBehaviour(LoaderBehaviourEnum value) { accountEntryLoaderBehaviour = value; } public LoaderBehaviourEnum getAddressLoaderBehaviour() { return (addressLoaderBehaviour); } public void setAddressLoaderBehaviour(LoaderBehaviourEnum value) { addressLoaderBehaviour = value; } public LoaderBehaviourEnum getAddressTagLoaderBehaviour() { return (addressTagLoaderBehaviour); } public void setAddressTagLoaderBehaviour(LoaderBehaviourEnum value) { addressTagLoaderBehaviour = value; } public LoaderBehaviourEnum getAttachmentLoaderBehaviour() { return (attachmentLoaderBehaviour); } public void setAttachmentLoaderBehaviour(LoaderBehaviourEnum value) { attachmentLoaderBehaviour = value; } public LoaderBehaviourEnum getAttachmentTagLoaderBehaviour() { return (attachmentTagLoaderBehaviour); } public void setAttachmentTagLoaderBehaviour(LoaderBehaviourEnum value) { attachmentTagLoaderBehaviour = value; } public LoaderBehaviourEnum getAuditActionLoaderBehaviour() { return (auditActionLoaderBehaviour); } public void setAuditActionLoaderBehaviour(LoaderBehaviourEnum value) { auditActionLoaderBehaviour = value; } public LoaderBehaviourEnum getClusterLoaderBehaviour() { return (clusterLoaderBehaviour); } public void setClusterLoaderBehaviour(LoaderBehaviourEnum value) { clusterLoaderBehaviour = value; } public LoaderBehaviourEnum getContactLoaderBehaviour() { return (contactLoaderBehaviour); } public void setContactLoaderBehaviour(LoaderBehaviourEnum value) { contactLoaderBehaviour = value; } public LoaderBehaviourEnum getContactListLoaderBehaviour() { return (contactListLoaderBehaviour); } public void setContactListLoaderBehaviour(LoaderBehaviourEnum value) { contactListLoaderBehaviour = value; } public LoaderBehaviourEnum getContactTagLoaderBehaviour() { return (contactTagLoaderBehaviour); } public void setContactTagLoaderBehaviour(LoaderBehaviourEnum value) { contactTagLoaderBehaviour = value; } public LoaderBehaviourEnum getContactURLLoaderBehaviour() { return (contactURLLoaderBehaviour); } public void setContactURLLoaderBehaviour(LoaderBehaviourEnum value) { contactURLLoaderBehaviour = value; } public LoaderBehaviourEnum getDomainLoaderBehaviour() { return (domainLoaderBehaviour); } public void setDomainLoaderBehaviour(LoaderBehaviourEnum value) { domainLoaderBehaviour = value; } public LoaderBehaviourEnum getDomainBaseLoaderBehaviour() { return (domainBaseLoaderBehaviour); } public void setDomainBaseLoaderBehaviour(LoaderBehaviourEnum value) { domainBaseLoaderBehaviour = value; } public LoaderBehaviourEnum getHostNodeLoaderBehaviour() { return (hostNodeLoaderBehaviour); } public void setHostNodeLoaderBehaviour(LoaderBehaviourEnum value) { hostNodeLoaderBehaviour = value; } public LoaderBehaviourEnum getISOCountryLoaderBehaviour() { return (iSOCountryLoaderBehaviour); } public void setISOCountryLoaderBehaviour(LoaderBehaviourEnum value) { iSOCountryLoaderBehaviour = value; } public LoaderBehaviourEnum getISOCountryCurrencyLoaderBehaviour() { return (iSOCountryCurrencyLoaderBehaviour); } public void setISOCountryCurrencyLoaderBehaviour(LoaderBehaviourEnum value) { iSOCountryCurrencyLoaderBehaviour = value; } public LoaderBehaviourEnum getISOCountryLanguageLoaderBehaviour() { return (iSOCountryLanguageLoaderBehaviour); } public void setISOCountryLanguageLoaderBehaviour(LoaderBehaviourEnum value) { iSOCountryLanguageLoaderBehaviour = value; } public LoaderBehaviourEnum getISOCurrencyLoaderBehaviour() { return (iSOCurrencyLoaderBehaviour); } public void setISOCurrencyLoaderBehaviour(LoaderBehaviourEnum value) { iSOCurrencyLoaderBehaviour = value; } public LoaderBehaviourEnum getISOLanguageLoaderBehaviour() { return (iSOLanguageLoaderBehaviour); } public void setISOLanguageLoaderBehaviour(LoaderBehaviourEnum value) { iSOLanguageLoaderBehaviour = value; } public LoaderBehaviourEnum getISOTimezoneLoaderBehaviour() { return (iSOTimezoneLoaderBehaviour); } public void setISOTimezoneLoaderBehaviour(LoaderBehaviourEnum value) { iSOTimezoneLoaderBehaviour = value; } public LoaderBehaviourEnum getMajorVersionLoaderBehaviour() { return (majorVersionLoaderBehaviour); } public void setMajorVersionLoaderBehaviour(LoaderBehaviourEnum value) { majorVersionLoaderBehaviour = value; } public LoaderBehaviourEnum getMemoLoaderBehaviour() { return (memoLoaderBehaviour); } public void setMemoLoaderBehaviour(LoaderBehaviourEnum value) { memoLoaderBehaviour = value; } public LoaderBehaviourEnum getMemoTagLoaderBehaviour() { return (memoTagLoaderBehaviour); } public void setMemoTagLoaderBehaviour(LoaderBehaviourEnum value) { memoTagLoaderBehaviour = value; } public LoaderBehaviourEnum getMimeTypeLoaderBehaviour() { return (mimeTypeLoaderBehaviour); } public void setMimeTypeLoaderBehaviour(LoaderBehaviourEnum value) { mimeTypeLoaderBehaviour = value; } public LoaderBehaviourEnum getMinorVersionLoaderBehaviour() { return (minorVersionLoaderBehaviour); } public void setMinorVersionLoaderBehaviour(LoaderBehaviourEnum value) { minorVersionLoaderBehaviour = value; } public LoaderBehaviourEnum getPhoneLoaderBehaviour() { return (phoneLoaderBehaviour); } public void setPhoneLoaderBehaviour(LoaderBehaviourEnum value) { phoneLoaderBehaviour = value; } public LoaderBehaviourEnum getPhoneTagLoaderBehaviour() { return (phoneTagLoaderBehaviour); } public void setPhoneTagLoaderBehaviour(LoaderBehaviourEnum value) { phoneTagLoaderBehaviour = value; } public LoaderBehaviourEnum getProjectBaseLoaderBehaviour() { return (projectBaseLoaderBehaviour); } public void setProjectBaseLoaderBehaviour(LoaderBehaviourEnum value) { projectBaseLoaderBehaviour = value; } public LoaderBehaviourEnum getRealProjectLoaderBehaviour() { return (realProjectLoaderBehaviour); } public void setRealProjectLoaderBehaviour(LoaderBehaviourEnum value) { realProjectLoaderBehaviour = value; } public LoaderBehaviourEnum getSecAppLoaderBehaviour() { return (secAppLoaderBehaviour); } public void setSecAppLoaderBehaviour(LoaderBehaviourEnum value) { secAppLoaderBehaviour = value; } public LoaderBehaviourEnum getSecFormLoaderBehaviour() { return (secFormLoaderBehaviour); } public void setSecFormLoaderBehaviour(LoaderBehaviourEnum value) { secFormLoaderBehaviour = value; } public LoaderBehaviourEnum getSecGroupLoaderBehaviour() { return (secGroupLoaderBehaviour); } public void setSecGroupLoaderBehaviour(LoaderBehaviourEnum value) { secGroupLoaderBehaviour = value; } public LoaderBehaviourEnum getSecGroupFormLoaderBehaviour() { return (secGroupFormLoaderBehaviour); } public void setSecGroupFormLoaderBehaviour(LoaderBehaviourEnum value) { secGroupFormLoaderBehaviour = value; } public LoaderBehaviourEnum getSecGroupIncludeLoaderBehaviour() { return (secGroupIncludeLoaderBehaviour); } public void setSecGroupIncludeLoaderBehaviour(LoaderBehaviourEnum value) { secGroupIncludeLoaderBehaviour = value; } public LoaderBehaviourEnum getSecGroupMemberLoaderBehaviour() { return (secGroupMemberLoaderBehaviour); } public void setSecGroupMemberLoaderBehaviour(LoaderBehaviourEnum value) { secGroupMemberLoaderBehaviour = value; } public LoaderBehaviourEnum getSecSessionLoaderBehaviour() { return (secSessionLoaderBehaviour); } public void setSecSessionLoaderBehaviour(LoaderBehaviourEnum value) { secSessionLoaderBehaviour = value; } public LoaderBehaviourEnum getSecUserLoaderBehaviour() { return (secUserLoaderBehaviour); } public void setSecUserLoaderBehaviour(LoaderBehaviourEnum value) { secUserLoaderBehaviour = value; } public LoaderBehaviourEnum getServiceLoaderBehaviour() { return (serviceLoaderBehaviour); } public void setServiceLoaderBehaviour(LoaderBehaviourEnum value) { serviceLoaderBehaviour = value; } public LoaderBehaviourEnum getServiceTypeLoaderBehaviour() { return (serviceTypeLoaderBehaviour); } public void setServiceTypeLoaderBehaviour(LoaderBehaviourEnum value) { serviceTypeLoaderBehaviour = value; } public LoaderBehaviourEnum getSubProjectLoaderBehaviour() { return (subProjectLoaderBehaviour); } public void setSubProjectLoaderBehaviour(LoaderBehaviourEnum value) { subProjectLoaderBehaviour = value; } public LoaderBehaviourEnum getTSecGroupLoaderBehaviour() { return (tSecGroupLoaderBehaviour); } public void setTSecGroupLoaderBehaviour(LoaderBehaviourEnum value) { tSecGroupLoaderBehaviour = value; } public LoaderBehaviourEnum getTSecGroupIncludeLoaderBehaviour() { return (tSecGroupIncludeLoaderBehaviour); } public void setTSecGroupIncludeLoaderBehaviour(LoaderBehaviourEnum value) { tSecGroupIncludeLoaderBehaviour = value; } public LoaderBehaviourEnum getTSecGroupMemberLoaderBehaviour() { return (tSecGroupMemberLoaderBehaviour); } public void setTSecGroupMemberLoaderBehaviour(LoaderBehaviourEnum value) { tSecGroupMemberLoaderBehaviour = value; } public LoaderBehaviourEnum getTagLoaderBehaviour() { return (tagLoaderBehaviour); } public void setTagLoaderBehaviour(LoaderBehaviourEnum value) { tagLoaderBehaviour = value; } public LoaderBehaviourEnum getTenantLoaderBehaviour() { return (tenantLoaderBehaviour); } public void setTenantLoaderBehaviour(LoaderBehaviourEnum value) { tenantLoaderBehaviour = value; } public LoaderBehaviourEnum getTldLoaderBehaviour() { return (tldLoaderBehaviour); } public void setTldLoaderBehaviour(LoaderBehaviourEnum value) { tldLoaderBehaviour = value; } public LoaderBehaviourEnum getTopDomainLoaderBehaviour() { return (topDomainLoaderBehaviour); } public void setTopDomainLoaderBehaviour(LoaderBehaviourEnum value) { topDomainLoaderBehaviour = value; } public LoaderBehaviourEnum getTopProjectLoaderBehaviour() { return (topProjectLoaderBehaviour); } public void setTopProjectLoaderBehaviour(LoaderBehaviourEnum value) { topProjectLoaderBehaviour = value; } public LoaderBehaviourEnum getURLProtocolLoaderBehaviour() { return (uRLProtocolLoaderBehaviour); } public void setURLProtocolLoaderBehaviour(LoaderBehaviourEnum value) { uRLProtocolLoaderBehaviour = value; } public LoaderBehaviourEnum getVersionLoaderBehaviour() { return (versionLoaderBehaviour); } public void setVersionLoaderBehaviour(LoaderBehaviourEnum value) { versionLoaderBehaviour = value; } // Parse a file public void parseFile(String url) { parse(url); } }