src/share/jaxws_classes/com/sun/tools/internal/ws/processor/modeler/annotation/AnnotationProcessorContext.java

Print this page


   1 /*
   2  * Copyright (c) 1997, 2010, 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


  40 import java.util.Map;
  41 
  42 
  43 /**
  44  *
  45  * @author  dkohlert
  46  */
  47 public class AnnotationProcessorContext {
  48 
  49     private Map<Name, SeiContext> seiContextMap = new HashMap<Name, SeiContext>();
  50     private int round = 1;
  51     private boolean modelCompleted = false;
  52 
  53     public void addSeiContext(Name seiName, SeiContext seiContext) {
  54         seiContextMap.put(seiName, seiContext);
  55     }
  56 
  57     public SeiContext getSeiContext(Name seiName) {
  58         SeiContext context = seiContextMap.get(seiName);
  59         if (context == null) {
  60             context = new SeiContext(seiName);
  61             addSeiContext(seiName, context);
  62         }
  63         return context;
  64     }
  65 
  66     public SeiContext getSeiContext(TypeElement d) {
  67         return getSeiContext(d.getQualifiedName());
  68     }
  69 
  70     public Collection<SeiContext> getSeiContexts() {
  71         return seiContextMap.values();
  72     }
  73 
  74     public int getRound() {
  75         return round;
  76     }
  77 
  78     public void incrementRound() {
  79         round++;
  80     }


  90                 }
  91             }
  92         }
  93         return true;
  94     }
  95 
  96     public void setModelCompleted(boolean modelCompleted) {
  97         this.modelCompleted = modelCompleted;
  98     }
  99 
 100     public boolean isModelCompleted() {
 101         return modelCompleted;
 102     }
 103 
 104     public static class SeiContext {
 105 
 106         private Map<String, WrapperInfo> reqOperationWrapperMap = new HashMap<String, WrapperInfo>();
 107         private Map<String, WrapperInfo> resOperationWrapperMap = new HashMap<String, WrapperInfo>();
 108         private Map<Name, FaultInfo> exceptionBeanMap = new HashMap<Name, FaultInfo>();
 109 
 110         private Name seiName;
 111         private Name seiImplName;
 112         private boolean implementsSei;
 113         private String namespaceUri;
 114 
 115         public SeiContext(Name seiName) {
 116             this.seiName = seiName;
 117         }




 118 
 119         public void setImplementsSei(boolean implementsSei) {
 120             this.implementsSei = implementsSei;
 121         }
 122 
 123         public boolean getImplementsSei() {
 124             return implementsSei;
 125         }
 126 
 127         public void setNamespaceUri(String namespaceUri) {
 128             this.namespaceUri = namespaceUri;
 129         }
 130 
 131         public String getNamespaceUri() {
 132             return namespaceUri;
 133         }
 134 
 135         public Name getSeiImplName() {
 136             return seiImplName;
 137         }


   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


  40 import java.util.Map;
  41 
  42 
  43 /**
  44  *
  45  * @author  dkohlert
  46  */
  47 public class AnnotationProcessorContext {
  48 
  49     private Map<Name, SeiContext> seiContextMap = new HashMap<Name, SeiContext>();
  50     private int round = 1;
  51     private boolean modelCompleted = false;
  52 
  53     public void addSeiContext(Name seiName, SeiContext seiContext) {
  54         seiContextMap.put(seiName, seiContext);
  55     }
  56 
  57     public SeiContext getSeiContext(Name seiName) {
  58         SeiContext context = seiContextMap.get(seiName);
  59         if (context == null) {
  60             context = new SeiContext();
  61             addSeiContext(seiName, context);
  62         }
  63         return context;
  64     }
  65 
  66     public SeiContext getSeiContext(TypeElement d) {
  67         return getSeiContext(d.getQualifiedName());
  68     }
  69 
  70     public Collection<SeiContext> getSeiContexts() {
  71         return seiContextMap.values();
  72     }
  73 
  74     public int getRound() {
  75         return round;
  76     }
  77 
  78     public void incrementRound() {
  79         round++;
  80     }


  90                 }
  91             }
  92         }
  93         return true;
  94     }
  95 
  96     public void setModelCompleted(boolean modelCompleted) {
  97         this.modelCompleted = modelCompleted;
  98     }
  99 
 100     public boolean isModelCompleted() {
 101         return modelCompleted;
 102     }
 103 
 104     public static class SeiContext {
 105 
 106         private Map<String, WrapperInfo> reqOperationWrapperMap = new HashMap<String, WrapperInfo>();
 107         private Map<String, WrapperInfo> resOperationWrapperMap = new HashMap<String, WrapperInfo>();
 108         private Map<Name, FaultInfo> exceptionBeanMap = new HashMap<Name, FaultInfo>();
 109 

 110         private Name seiImplName;
 111         private boolean implementsSei;
 112         private String namespaceUri;
 113 
 114         public SeiContext() {};
 115 
 116         /**
 117          * @deprecated use empty constructor, seiName value is ignored
 118          * @param seiName
 119          */
 120         public SeiContext(Name seiName) {};
 121 
 122         public void setImplementsSei(boolean implementsSei) {
 123             this.implementsSei = implementsSei;
 124         }
 125 
 126         public boolean getImplementsSei() {
 127             return implementsSei;
 128         }
 129 
 130         public void setNamespaceUri(String namespaceUri) {
 131             this.namespaceUri = namespaceUri;
 132         }
 133 
 134         public String getNamespaceUri() {
 135             return namespaceUri;
 136         }
 137 
 138         public Name getSeiImplName() {
 139             return seiImplName;
 140         }