src/share/jaxws_classes/com/sun/tools/internal/ws/processor/model/ModelObject.java

Thu, 31 Aug 2017 15:18:52 +0800

author
aoqi
date
Thu, 31 Aug 2017 15:18:52 +0800
changeset 637
9c07ef4934dd
parent 368
0989ad8c0860
parent 0
373ffda63c9a
permissions
-rw-r--r--

merge

     1 /*
     2  * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     8  * particular file as subject to the "Classpath" exception as provided
     9  * by Oracle in the LICENSE file that accompanied this code.
    10  *
    11  * This code is distributed in the hope that it will be useful, but WITHOUT
    12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    14  * version 2 for more details (a copy is included in the LICENSE file that
    15  * accompanied this code).
    16  *
    17  * You should have received a copy of the GNU General Public License version
    18  * 2 along with this work; if not, write to the Free Software Foundation,
    19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    20  *
    21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    22  * or visit www.oracle.com if you need additional information or have any
    23  * questions.
    24  */
    26 package com.sun.tools.internal.ws.processor.model;
    28 import com.sun.tools.internal.ws.wsdl.framework.Entity;
    29 import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
    31 import java.util.Collections;
    32 import java.util.HashMap;
    33 import java.util.Iterator;
    34 import java.util.Map;
    36 import org.xml.sax.Locator;
    38 /**
    39  *
    40  * @author WS Development Team
    41  */
    42 public abstract class ModelObject {
    43     public abstract void accept(ModelVisitor visitor) throws Exception;
    45     private final Entity entity;
    46     protected ErrorReceiver errorReceiver;
    48     protected ModelObject(Entity entity) {
    49         this.entity = entity;
    50     }
    52     public void setErrorReceiver(ErrorReceiver errorReceiver) {
    53         this.errorReceiver = errorReceiver;
    54     }
    56     public Entity getEntity() {
    57         return entity;
    58     }
    60     public Object getProperty(String key) {
    61         if (_properties == null) {
    62             return null;
    63         }
    64         return _properties.get(key);
    65     }
    67     public void setProperty(String key, Object value) {
    68         if (value == null) {
    69             removeProperty(key);
    70             return;
    71         }
    73         if (_properties == null) {
    74             _properties = new HashMap();
    75         }
    76         _properties.put(key, value);
    77     }
    79     public void removeProperty(String key) {
    80         if (_properties != null) {
    81             _properties.remove(key);
    82         }
    83     }
    85     public Iterator getProperties() {
    86         if (_properties == null) {
    87             return Collections.emptyList().iterator();
    88         } else {
    89             return _properties.keySet().iterator();
    90         }
    91     }
    93     public Locator getLocator(){
    94         return entity.getLocator();
    95     }
    97     public Map getPropertiesMap() {
    98         return _properties;
    99     }
   101     public void setPropertiesMap(Map m) {
   102         _properties = m;
   103     }
   105     public String getJavaDoc() {
   106         return javaDoc;
   107     }
   109     public void setJavaDoc(String javaDoc) {
   110         this.javaDoc = javaDoc;
   111     }
   113     private String javaDoc;
   114     private Map _properties;
   115 }

mercurial