[java-opensaml COMMIT] in /trunk/opensaml-core/src/main/java/org/opensaml/xml/io: AbstractXMLObjectMarshaller.java Ab...
noreply at shibboleth.net
noreply at shibboleth.net
Fri Aug 26 22:20:30 BST 2011
Author: lajoie
Date: Fri Aug 26 22:20:29 2011
New Revision: 2880
URL: http://svn.shibboleth.net/view/java-opensaml?rev=2880&view=rev
Log:
Add default no-op method implementations
Modified:
trunk/opensaml-core/src/main/java/org/opensaml/xml/io/AbstractXMLObjectMarshaller.java
trunk/opensaml-core/src/main/java/org/opensaml/xml/io/AbstractXMLObjectUnmarshaller.java
Modified: trunk/opensaml-core/src/main/java/org/opensaml/xml/io/AbstractXMLObjectMarshaller.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-core/src/main/java/org/opensaml/xml/io/AbstractXMLObjectMarshaller.java?rev=2880&r1=2879&r2=2880&view=diff
==============================================================================
--- trunk/opensaml-core/src/main/java/org/opensaml/xml/io/AbstractXMLObjectMarshaller.java (original)
+++ trunk/opensaml-core/src/main/java/org/opensaml/xml/io/AbstractXMLObjectMarshaller.java Fri Aug 26 22:20:29 2011
@@ -419,22 +419,30 @@
* marshaller for child elements. The XMLObject passed to this method is guaranteed to be of the target name
* specified during this unmarshaller's construction.
*
+ * This default implementation of this method is a no-op
+ *
* @param xmlObject the XMLObject to marshall
* @param domElement the W3C DOM element
*
* @throws MarshallingException thrown if there is a problem marshalling the element
*/
- protected abstract void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException;
+ protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException{
+
+ }
/**
* Marshalls data from the XMLObject into content of the DOM Element.
+ *
+ * The default implementation of this method is a no-op.
*
* @param xmlObject the XMLObject
* @param domElement the DOM element recieving the content
*
* @throws MarshallingException thrown if the textual content can not be added to the DOM element
*/
- protected abstract void marshallElementContent(XMLObject xmlObject, Element domElement) throws MarshallingException;
+ protected void marshallElementContent(XMLObject xmlObject, Element domElement) throws MarshallingException{
+
+ }
/**
* Prepares the given DOM caching XMLObject for adoption into another document. If the XMLObject has a parent then
Modified: trunk/opensaml-core/src/main/java/org/opensaml/xml/io/AbstractXMLObjectUnmarshaller.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-core/src/main/java/org/opensaml/xml/io/AbstractXMLObjectUnmarshaller.java?rev=2880&r1=2879&r2=2880&view=diff
==============================================================================
--- trunk/opensaml-core/src/main/java/org/opensaml/xml/io/AbstractXMLObjectUnmarshaller.java (original)
+++ trunk/opensaml-core/src/main/java/org/opensaml/xml/io/AbstractXMLObjectUnmarshaller.java Fri Aug 26 22:20:29 2011
@@ -19,6 +19,7 @@
import javax.xml.namespace.QName;
+import org.opensaml.util.xml.QNameSupport;
import org.opensaml.xml.Configuration;
import org.opensaml.xml.Namespace;
import org.opensaml.xml.XMLObject;
@@ -217,14 +218,14 @@
QName attribName = XMLHelper.getNodeQName(attribute);
log.trace("Pre-processing attribute {}", attribName);
String attributeNamespace = DatatypeHelper.safeTrimOrNullString(attribute.getNamespaceURI());
-
+
if (DatatypeHelper.safeEquals(attributeNamespace, XMLConstants.XMLNS_NS)) {
unmarshallNamespaceAttribute(xmlObject, attribute);
} else if (DatatypeHelper.safeEquals(attributeNamespace, XMLConstants.XSI_NS)) {
unmarshallSchemaInstanceAttributes(xmlObject, attribute);
} else {
- log.trace("Attribute {} is neither a schema type nor namespace, calling processAttribute()", XMLHelper
- .getNodeQName(attribute));
+ log.trace("Attribute {} is neither a schema type nor namespace, calling processAttribute()",
+ XMLHelper.getNodeQName(attribute));
String attributeNSURI = attribute.getNamespaceURI();
String attributeNSPrefix;
if (attributeNSURI != null) {
@@ -248,12 +249,12 @@
* @param attribute the namespace decleration attribute
*/
protected void unmarshallNamespaceAttribute(XMLObject xmlObject, Attr attribute) {
- log.trace("{} is a namespace declaration, adding it to the list of namespaces on the XMLObject", XMLHelper
- .getNodeQName(attribute));
+ log.trace("{} is a namespace declaration, adding it to the list of namespaces on the XMLObject",
+ XMLHelper.getNodeQName(attribute));
Namespace namespace;
- if(DatatypeHelper.safeEquals(attribute.getLocalName(), XMLConstants.XMLNS_PREFIX)){
+ if (DatatypeHelper.safeEquals(attribute.getLocalName(), XMLConstants.XMLNS_PREFIX)) {
namespace = new Namespace(attribute.getValue(), null);
- }else{
+ } else {
[... 89 lines stripped ...]
More information about the commits
mailing list