View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements. See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership. The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License. You may obtain a copy of the License at
9    *
10   * http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied. See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.ws.commons.schema.extensions;
20  
21  import org.apache.ws.commons.schema.XmlSchemaObject;
22  import org.w3c.dom.Node;
23  
24  import javax.xml.namespace.QName;
25  
26  /**
27   * Interface for the extension deserializer. The purpose of an instance
28   * of this is to deserialize the relevant attribute/element and perhaps generate
29   * a desired custom object. This custom object can be stored in the metadata map
30   * of the parent schema object. When to invoke a given deserializer is a decision
31   * taken by the extension registry
32   */
33  public interface ExtensionDeserializer {
34  
35      /**
36       * deserialize the given element
37       * @param schemaObject  - Parent schema element
38       * @param name - the QName of the element/attribute to be deserialized.
39       * in the case where a deserializer is used to handle multiple elements/attributes
40       * this may be useful to determine the correct deserialization
41       * @param domNode - the raw DOM Node read from the source. This will be the
42       * extension element itself if for an element or the extension attribute object if
43       * it is an attribute
44       *
45       */
46      public void deserialize(XmlSchemaObject schemaObject,
47                              QName name,
48                              Node domNode);
49  
50  }