jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/SchemaImpl.java
changeset 27837 86d4f46e622a
parent 25871 b80b84e87032
equal deleted inserted replaced
27581:9fffb959eb41 27837:86d4f46e622a
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     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
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    49 import java.util.ArrayList;
    49 import java.util.ArrayList;
    50 import java.util.Collection;
    50 import java.util.Collection;
    51 import java.util.Collections;
    51 import java.util.Collections;
    52 import java.util.HashMap;
    52 import java.util.HashMap;
    53 import java.util.Iterator;
    53 import java.util.Iterator;
       
    54 import java.util.LinkedHashMap;
    54 import java.util.List;
    55 import java.util.List;
    55 import java.util.Map;
    56 import java.util.Map;
    56 
    57 
    57 public class SchemaImpl implements XSSchema
    58 public class SchemaImpl implements XSSchema
    58 {
    59 {
   123     }
   124     }
   124     public Iterator<XSAttributeDecl> iterateAttributeDecls() {
   125     public Iterator<XSAttributeDecl> iterateAttributeDecls() {
   125         return atts.values().iterator();
   126         return atts.values().iterator();
   126     }
   127     }
   127 
   128 
   128     private final Map<String,XSElementDecl> elems = new HashMap<String,XSElementDecl>();
   129     private final Map<String, XSElementDecl> elems = new LinkedHashMap<String, XSElementDecl>();
   129     private final Map<String,XSElementDecl> elemsView = Collections.unmodifiableMap(elems);
   130     private final Map<String,XSElementDecl> elemsView = Collections.unmodifiableMap(elems);
   130     public void addElementDecl(XSElementDecl newDecl) {
   131     public void addElementDecl(XSElementDecl newDecl) {
   131         elems.put(newDecl.getName(), newDecl);
   132         elems.put(newDecl.getName(), newDecl);
   132     }
   133     }
   133     public Map<String,XSElementDecl> getElementDecls() {
   134     public Map<String,XSElementDecl> getElementDecls() {
   202 
   203 
   203     public XSIdentityConstraint getIdentityConstraint(String localName) {
   204     public XSIdentityConstraint getIdentityConstraint(String localName) {
   204         return idConstraints.get(localName);
   205         return idConstraints.get(localName);
   205     }
   206     }
   206 
   207 
   207     private final Map<String,XSType> allTypes = new HashMap<String,XSType>();
   208     private final Map<String, XSType> allTypes = new LinkedHashMap<String, XSType>();
   208     private final Map<String,XSType> allTypesView = Collections.unmodifiableMap(allTypes);
   209     private final Map<String,XSType> allTypesView = Collections.unmodifiableMap(allTypes);
   209 
   210 
   210     private final Map<String,XSSimpleType> simpleTypes = new HashMap<String,XSSimpleType>();
   211     private final Map<String,XSSimpleType> simpleTypes = new HashMap<String,XSSimpleType>();
   211     private final Map<String,XSSimpleType> simpleTypesView = Collections.unmodifiableMap(simpleTypes);
   212     private final Map<String,XSSimpleType> simpleTypesView = Collections.unmodifiableMap(simpleTypes);
   212     public void addSimpleType(XSSimpleType newDecl, boolean overwrite) {
   213     public void addSimpleType(XSSimpleType newDecl, boolean overwrite) {