jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XSComplexTypeDecl.java
changeset 27111 7a491d709b83
parent 25868 686eef1e7a79
equal deleted inserted replaced
26996:a137992d750c 27111:7a491d709b83
     1 /*
     1 /*
     2  * reserved comment block
     2  * reserved comment block
     3  * DO NOT REMOVE OR ALTER!
     3  * DO NOT REMOVE OR ALTER!
     4  */
     4  */
     5 /*
     5 /*
     6  * Copyright 2001-2005 The Apache Software Foundation.
     6  * Licensed to the Apache Software Foundation (ASF) under one or more
     7  *
     7  * contributor license agreements.  See the NOTICE file distributed with
     8  * Licensed under the Apache License, Version 2.0 (the "License");
     8  * this work for additional information regarding copyright ownership.
     9  * you may not use this file except in compliance with the License.
     9  * The ASF licenses this file to You under the Apache License, Version 2.0
    10  * You may obtain a copy of the License at
    10  * (the "License"); you may not use this file except in compliance with
       
    11  * the License.  You may obtain a copy of the License at
    11  *
    12  *
    12  *      http://www.apache.org/licenses/LICENSE-2.0
    13  *      http://www.apache.org/licenses/LICENSE-2.0
    13  *
    14  *
    14  * Unless required by applicable law or agreed to in writing, software
    15  * Unless required by applicable law or agreed to in writing, software
    15  * distributed under the License is distributed on an "AS IS" BASIS,
    16  * distributed under the License is distributed on an "AS IS" BASIS,
    75 
    76 
    76     // if there is a particle, the content model corresponding to that particle
    77     // if there is a particle, the content model corresponding to that particle
    77     volatile XSCMValidator fCMValidator = null;
    78     volatile XSCMValidator fCMValidator = null;
    78 
    79 
    79     // the content model that's sufficient for computing UPA
    80     // the content model that's sufficient for computing UPA
    80     XSCMValidator fUPACMValidator = null;
    81     volatile XSCMValidator fUPACMValidator = null;
    81 
    82 
    82     // list of annotations affiliated with this type
    83     // list of annotations affiliated with this type
    83     XSObjectListImpl fAnnotations = null;
    84     XSObjectListImpl fAnnotations = null;
    84 
    85 
    85     // The namespace schema information item corresponding to the target namespace
    86     // The namespace schema information item corresponding to the target namespace
   163         // there is no content model validator
   164         // there is no content model validator
   164         if (fContentType == XSComplexTypeDecl.CONTENTTYPE_SIMPLE ||
   165         if (fContentType == XSComplexTypeDecl.CONTENTTYPE_SIMPLE ||
   165             fContentType == XSComplexTypeDecl.CONTENTTYPE_EMPTY) {
   166             fContentType == XSComplexTypeDecl.CONTENTTYPE_EMPTY) {
   166             return null;
   167             return null;
   167         }
   168         }
   168         if (fCMValidator == null)
   169         if (fCMValidator == null) {
   169             synchronized (this) {
   170             fCMValidator = getContentModel(cmBuilder, false);
   170                 if (fCMValidator == null) {
   171         }
   171                     fCMValidator = cmBuilder.getContentModel(this);
   172         return fCMValidator;
       
   173     }
       
   174 
       
   175     public synchronized XSCMValidator getContentModel(CMBuilder cmBuilder, boolean forUPA) {
       
   176         if (fCMValidator == null) {
       
   177             if (forUPA) {
       
   178                 if (fUPACMValidator == null) {
       
   179                     fUPACMValidator = cmBuilder.getContentModel(this, true);
       
   180 
       
   181                     if (fUPACMValidator != null && !fUPACMValidator.isCompactedForUPA()) {
       
   182                         fCMValidator = fUPACMValidator;
       
   183                     }
   172                 }
   184                 }
   173             }
   185                 return fUPACMValidator;
       
   186             }
       
   187             else {
       
   188                 fCMValidator = cmBuilder.getContentModel(this, false);
       
   189             }
       
   190         }
   174         return fCMValidator;
   191         return fCMValidator;
   175     }
   192     }
   176 
   193 
   177     // some utility methods:
   194     // some utility methods:
   178 
   195