From: cantor Date: Thu, 13 Mar 2008 03:32:19 +0000 (+0000) Subject: Add new builder base class to indicate support for "argument-less" construction. X-Git-Tag: 1.4.1~355 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fxmltooling.git;a=commitdiff_plain;h=862161ef6283127928bd9307e1a184bf2ea0a6c8 Add new builder base class to indicate support for "argument-less" construction. Move sig/enc object implementations out of lite build. git-svn-id: https://svn.middleware.georgetown.edu/cpp-xmltooling/trunk@473 de75baf8-a10c-0410-a50a-987c0e22f00f --- diff --git a/.cproject b/.cproject index ad22b26..8cb2825 100644 --- a/.cproject +++ b/.cproject @@ -1,7 +1,4 @@ - - - - + diff --git a/xmltooling/ConcreteXMLObjectBuilder.h b/xmltooling/ConcreteXMLObjectBuilder.h new file mode 100644 index 0000000..41c1dbf --- /dev/null +++ b/xmltooling/ConcreteXMLObjectBuilder.h @@ -0,0 +1,52 @@ +/* + * Copyright 2001-2007 Internet2 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file xmltooling/ConcreteXMLObjectBuilder.h + * + * Factory interface for concrete XMLObjects, supporting default construction. + */ + +#ifndef __xmltooling_concxmlobjbuilder_h__ +#define __xmltooling_concxmlobjbuilder_h__ + +#include + +namespace xmltooling { + + /** + * A factory interface for obtaining XMLObjects. + * Subclasses MAY supply additional factory methods. + */ + class XMLTOOL_API ConcreteXMLObjectBuilder : public XMLObjectBuilder + { + public: + virtual ~ConcreteXMLObjectBuilder() {} + + /** + * Creates an empty XMLObject with a defaulted element name and/or type. + * + * @return the empty XMLObject + */ + virtual XMLObject* buildObject() const=0; + + protected: + ConcreteXMLObjectBuilder() {} + }; + +}; + +#endif /* __xmltooling_concxmlobjbuilder_h__ */ diff --git a/xmltooling/Makefile.am b/xmltooling/Makefile.am index d61b2ec..1a6cf05 100644 --- a/xmltooling/Makefile.am +++ b/xmltooling/Makefile.am @@ -32,6 +32,7 @@ libxmltoolinginclude_HEADERS = \ AbstractXMLObject.h \ AttributeExtensibleXMLObject.h \ base.h \ + ConcreteXMLObjectBuilder.h \ config_pub.h \ ElementExtensibleXMLObject.h \ ElementProxy.h \ @@ -126,6 +127,8 @@ xmlsec_sources = \ encryption/impl/Decrypter.cpp \ encryption/impl/EncryptedKeyResolver.cpp \ encryption/impl/Encrypter.cpp \ + encryption/impl/EncryptionImpl.cpp \ + encryption/impl/EncryptionSchemaValidators.cpp \ impl/MemoryStorageService.cpp \ security/impl/AbstractPKIXTrustEngine.cpp \ security/impl/BasicX509Credential.cpp \ @@ -141,6 +144,8 @@ xmlsec_sources = \ security/impl/StaticPKIXTrustEngine.cpp \ security/impl/TrustEngine.cpp \ security/impl/XSECCryptoX509CRL.cpp \ + signature/impl/KeyInfoImpl.cpp \ + signature/impl/KeyInfoSchemaValidators.cpp \ signature/impl/SignatureValidator.cpp \ signature/impl/XMLSecSignatureImpl.cpp \ soap/impl/CURLSOAPTransport.cpp \ @@ -167,15 +172,11 @@ common_sources = \ unicode.cpp \ XMLObjectBuilder.cpp \ XMLToolingConfig.cpp \ - encryption/impl/EncryptionImpl.cpp \ - encryption/impl/EncryptionSchemaValidators.cpp \ impl/AnyElement.cpp \ impl/UnknownElement.cpp \ io/AbstractXMLObjectMarshaller.cpp \ io/AbstractXMLObjectUnmarshaller.cpp \ io/HTTPRequest.cpp \ - signature/impl/KeyInfoImpl.cpp \ - signature/impl/KeyInfoSchemaValidators.cpp \ soap/impl/SOAPClient.cpp \ soap/impl/SOAPImpl.cpp \ soap/impl/SOAPSchemaValidators.cpp \ diff --git a/xmltooling/XMLObjectBuilder.h b/xmltooling/XMLObjectBuilder.h index bc16bbc..80fa690 100644 --- a/xmltooling/XMLObjectBuilder.h +++ b/xmltooling/XMLObjectBuilder.h @@ -17,7 +17,7 @@ /** * @file xmltooling/XMLObjectBuilder.h * - * Factory interface for XMLObjects + * Factory interface for XMLObjects. */ #ifndef __xmltooling_xmlobjbuilder_h__ @@ -47,7 +47,7 @@ namespace xmltooling { /** * Creates an empty XMLObject with a particular element name. - * The results are undefined if localName is NULL or empty. + *

The results are undefined if localName is NULL or empty. * * @param nsURI namespace URI for element * @param localName local name of element diff --git a/xmltooling/XMLToolingConfig.cpp b/xmltooling/XMLToolingConfig.cpp index 82dbc8d..ee9cc3c 100644 --- a/xmltooling/XMLToolingConfig.cpp +++ b/xmltooling/XMLToolingConfig.cpp @@ -65,8 +65,6 @@ #endif using namespace soap11; -using namespace xmlencryption; -using namespace xmlsignature; using namespace xmltooling::logging; using namespace xmltooling; using namespace std; @@ -82,6 +80,8 @@ DECL_XMLTOOLING_EXCEPTION_FACTORY(ValidationException,xmltooling); DECL_XMLTOOLING_EXCEPTION_FACTORY(IOException,xmltooling); #ifndef XMLTOOLING_NO_XMLSEC +using namespace xmlencryption; +using namespace xmlsignature; DECL_XMLTOOLING_EXCEPTION_FACTORY(XMLSecurityException,xmltooling); DECL_XMLTOOLING_EXCEPTION_FACTORY(SignatureException,xmlsignature); DECL_XMLTOOLING_EXCEPTION_FACTORY(EncryptionException,xmlencryption); @@ -256,8 +256,6 @@ bool XMLToolingInternalConfig::init() // default registrations XMLObjectBuilder::registerDefaultBuilder(new UnknownElementBuilder()); - registerKeyInfoClasses(); - registerEncryptionClasses(); registerSOAPClasses(); REGISTER_XMLTOOLING_EXCEPTION_FACTORY(XMLParserException,xmltooling); @@ -274,6 +272,8 @@ bool XMLToolingInternalConfig::init() REGISTER_XMLTOOLING_EXCEPTION_FACTORY(XMLSecurityException,xmltooling); REGISTER_XMLTOOLING_EXCEPTION_FACTORY(SignatureException,xmlsignature); REGISTER_XMLTOOLING_EXCEPTION_FACTORY(EncryptionException,xmlencryption); + registerKeyInfoClasses(); + registerEncryptionClasses(); registerKeyInfoResolvers(); registerCredentialResolvers(); registerTrustEngines(); diff --git a/xmltooling/base.h b/xmltooling/base.h index 76fdc50..4936a8a 100644 --- a/xmltooling/base.h +++ b/xmltooling/base.h @@ -1222,7 +1222,7 @@ */ #define BEGIN_XMLOBJECTBUILDER(linkage,cname,namespaceURI,namespacePrefix) \ XMLTOOLING_DOXYGEN(Builder for cname objects.) \ - class linkage cname##Builder : public xmltooling::XMLObjectBuilder { \ + class linkage cname##Builder : public xmltooling::ConcreteXMLObjectBuilder { \ public: \ virtual ~cname##Builder() {} \ XMLTOOLING_DOXYGEN(Default builder.) \ @@ -1287,7 +1287,7 @@ */ #define BEGIN_XMLOBJECTBUILDER(linkage,cname,namespaceURI,namespacePrefix) \ XMLTOOLING_DOXYGEN(Builder for cname objects.) \ - class linkage cname##Builder : public xmltooling::XMLObjectBuilder { \ + class linkage cname##Builder : public xmltooling::ConcreteXMLObjectBuilder { \ public: \ virtual ~cname##Builder() {} \ XMLTOOLING_DOXYGEN(Default builder.) \ diff --git a/xmltooling/encryption/Encryption.h b/xmltooling/encryption/Encryption.h index 3c1ee40..c1fb590 100644 --- a/xmltooling/encryption/Encryption.h +++ b/xmltooling/encryption/Encryption.h @@ -20,7 +20,7 @@ * XMLObjects representing XML Encryption content */ -#ifndef __xmltooling_encryption_h__ +#if !defined(__xmltooling_encryption_h__) && !defined(XMLTOOLING_NO_XMLSEC) #define __xmltooling_encryption_h__ #include diff --git a/xmltooling/security/CredentialContext.h b/xmltooling/security/CredentialContext.h index 4add335..7cd3abd 100644 --- a/xmltooling/security/CredentialContext.h +++ b/xmltooling/security/CredentialContext.h @@ -17,7 +17,7 @@ /** * @file xmltooling/security/CredentialContext.h * - * Marker interface for implementations which hold information specific to a + * Marker interface for implementations which hold information specific to a * particular context within which a CredentialResolver resolves a Credential. */ @@ -28,10 +28,10 @@ namespace xmltooling { - /** - * Marker interface for implementations which hold information specific to a - * particular context within which a CredentialResolver resolves a Credential. - */ + /** + * Marker interface for implementations which hold information specific to a + * particular context within which a CredentialResolver resolves a Credential. + */ class XMLTOOL_API CredentialContext { MAKE_NONCOPYABLE(CredentialContext); diff --git a/xmltooling/signature/KeyInfo.h b/xmltooling/signature/KeyInfo.h index d9382a8..931caa9 100644 --- a/xmltooling/signature/KeyInfo.h +++ b/xmltooling/signature/KeyInfo.h @@ -21,11 +21,11 @@ * and related content. */ -#ifndef __xmltooling_keyinfo_h__ +#if !defined(__xmltooling_keyinfo_h__) && !defined(XMLTOOLING_NO_XMLSEC) #define __xmltooling_keyinfo_h__ +#include #include -#include #include /** diff --git a/xmltooling/signature/Signature.h b/xmltooling/signature/Signature.h index 4196295..77aabda 100644 --- a/xmltooling/signature/Signature.h +++ b/xmltooling/signature/Signature.h @@ -23,8 +23,8 @@ #if !defined(__xmltooling_sig_h__) && !defined(XMLTOOLING_NO_XMLSEC) #define __xmltooling_sig_h__ +#include #include -#include #include #include diff --git a/xmltooling/soap/SOAP.h b/xmltooling/soap/SOAP.h index 031599b..ff2de77 100644 --- a/xmltooling/soap/SOAP.h +++ b/xmltooling/soap/SOAP.h @@ -23,8 +23,8 @@ #ifndef __xmltooling_soap_h__ #define __xmltooling_soap_h__ +#include #include -#include #include #include @@ -51,13 +51,13 @@ namespace soap11 { /** Sets the QName content of the element. */ virtual void setCode(const xmltooling::QName* qname)=0; /** Client Fault code. **/ - static xmltooling::QName CLIENT; - /** Server Fault code. **/ - static xmltooling::QName SERVER; - /** MustUnderstand Fault code. **/ - static xmltooling::QName MUSTUNDERSTAND; - /** Version Mismatch Fault code. **/ - static xmltooling::QName VERSIONMISMATCH; + static xmltooling::QName CLIENT; + /** Server Fault code. **/ + static xmltooling::QName SERVER; + /** MustUnderstand Fault code. **/ + static xmltooling::QName MUSTUNDERSTAND; + /** Version Mismatch Fault code. **/ + static xmltooling::QName VERSIONMISMATCH; END_XMLOBJECT; BEGIN_XMLOBJECT(XMLTOOL_API,Detail,xmltooling::ElementProxy,SOAP 1.1 detail element); diff --git a/xmltooling/xmltooling-lite.vcproj b/xmltooling/xmltooling-lite.vcproj index a13eaf8..f98c241 100644 --- a/xmltooling/xmltooling-lite.vcproj +++ b/xmltooling/xmltooling-lite.vcproj @@ -309,38 +309,6 @@ - - - - - - - - - - - - - - - - + + @@ -543,22 +515,6 @@ - - - - - - - - + +