Author: sagara
Date: Wed Sep 9 16:05:08 2009
New Revision: 813018
URL: http://svn.apache.org/viewvc?rev=813018&view=rev
Log:
WODEN-220 - added OMWSDLSource
Added:
webservices/woden/trunk/java/woden-om/src/main/java/org/apache/woden/internal/OMWSDLSource.java
(with props)
Added:
webservices/woden/trunk/java/woden-om/src/main/java/org/apache/woden/internal/OMWSDLSource.java
URL:
http://svn.apache.org/viewvc/webservices/woden/trunk/java/woden-om/src/main/java/org/apache/woden/internal/OMWSDLSource.java?rev=813018&view=auto
==============================================================================
---
webservices/woden/trunk/java/woden-om/src/main/java/org/apache/woden/internal/OMWSDLSource.java
(added)
+++
webservices/woden/trunk/java/woden-om/src/main/java/org/apache/woden/internal/OMWSDLSource.java
Wed Sep 9 16:05:08 2009
@@ -0,0 +1,56 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+package org.apache.woden.internal;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.woden.ErrorReporter;
+/**
+ * This class provides a WSDLSource implementation that supports a
+ * OM-based representation of the WSDL source. Specifically, it
+ * may accept via its <code>setSource</code> method an object of type
+ * org.apache.axiom.om.OMElement.Any other type of object passed to
+ * this method will result in a WSDLException being thrown.
+ *
+ * @author Sagara Gunathunga ([email protected])
+ */
+public class OMWSDLSource extends BaseWSDLSource {
+
+ public OMWSDLSource(ErrorReporter errorReporter) {
+ super(errorReporter);
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.woden.WSDLSource#setSource(java.lang.Object)
+ */
+ public void setSource(Object wsdlSource) {
+
+ //TODO check if any other types of wsdl source should be supported
+ if(wsdlSource instanceof OMElement ) {
+ fSource = wsdlSource;
+ }
+ else {
+ String sourceClass = (wsdlSource != null
+ ? wsdlSource.getClass().getName()
+ : null);
+ String wsdlSourceClass = this.getClass().getName();
+ String msg = fErrorReporter.getFormattedMessage(
+ "WSDL018", new Object[] {sourceClass, wsdlSourceClass});
+ throw new IllegalArgumentException(msg);
+ }
+ }
+
+}
Propchange:
webservices/woden/trunk/java/woden-om/src/main/java/org/apache/woden/internal/OMWSDLSource.java
------------------------------------------------------------------------------
svn:eol-style = native
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]