< prev index next >

src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/dtd/models/DFAContentModel.java

Print this page


   1 /*
   2  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
   3  * @LastModified: Oct 2017
   4  */
   5 /*
   6  * Licensed to the Apache Software Foundation (ASF) under one or more
   7  * contributor license agreements.  See the NOTICE file distributed with
   8  * this work for additional information regarding copyright ownership.
   9  * The ASF licenses this file to You under the Apache License, Version 2.0
  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
  12  *
  13  *      http://www.apache.org/licenses/LICENSE-2.0
  14  *
  15  * Unless required by applicable law or agreed to in writing, software
  16  * distributed under the License is distributed on an "AS IS" BASIS,
  17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  18  * See the License for the specific language governing permissions and
  19  * limitations under the License.
  20  */
  21 
  22 package com.sun.org.apache.xerces.internal.impl.dtd.models;
  23 
  24 import com.sun.org.apache.xerces.internal.impl.dtd.XMLContentSpec;
  25 import com.sun.org.apache.xerces.internal.xni.QName;
  26 import java.util.HashMap;
  27 import java.util.Map;
  28 
  29 /**
  30 
  31  * DFAContentModel is the derivative of ContentModel that does
  32  * all of the non-trivial element content validation. This class does
  33  * the conversion from the regular expression to the DFA that
  34  * it then uses in its validation algorithm.
  35  * <p>
  36  * <b>Note:</b> Upstream work insures that this class will never see
  37  * a content model with PCDATA in it. Any model with PCDATA is 'mixed'
  38  * and is handled via the MixedContentModel class since mixed models
  39  * are very constrained in form and easily handled via a special case.
  40  * This also makes implementation of this class much easier.
  41  *
  42  * @xerces.internal
  43  *

  44  */
  45 public class DFAContentModel
  46     implements ContentModelValidator {
  47 
  48     //
  49     // Constants
  50     //
  51     // special strings
  52 
  53     /** Epsilon string. */
  54     private static String fEpsilonString = "<<CMNODE_EPSILON>>";
  55 
  56     /** End-of-content string. */
  57     private static String fEOCString = "<<CMNODE_EOC>>";
  58 
  59     /** initializing static members **/
  60     static {
  61         fEpsilonString = fEpsilonString.intern();
  62         fEOCString = fEOCString.intern();
  63     }


   1 /*
   2  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.

   3  */
   4 /*
   5  * Licensed to the Apache Software Foundation (ASF) under one or more
   6  * contributor license agreements.  See the NOTICE file distributed with
   7  * this work for additional information regarding copyright ownership.
   8  * The ASF licenses this file to You under the Apache License, Version 2.0
   9  * (the "License"); you may not use this file except in compliance with
  10  * the License.  You may obtain a copy of the License at
  11  *
  12  *      http://www.apache.org/licenses/LICENSE-2.0
  13  *
  14  * Unless required by applicable law or agreed to in writing, software
  15  * distributed under the License is distributed on an "AS IS" BASIS,
  16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17  * See the License for the specific language governing permissions and
  18  * limitations under the License.
  19  */
  20 
  21 package com.sun.org.apache.xerces.internal.impl.dtd.models;
  22 
  23 import com.sun.org.apache.xerces.internal.impl.dtd.XMLContentSpec;
  24 import com.sun.org.apache.xerces.internal.xni.QName;
  25 import java.util.HashMap;
  26 import java.util.Map;
  27 
  28 /**
  29 
  30  * DFAContentModel is the derivative of ContentModel that does
  31  * all of the non-trivial element content validation. This class does
  32  * the conversion from the regular expression to the DFA that
  33  * it then uses in its validation algorithm.
  34  * <p>
  35  * <b>Note:</b> Upstream work insures that this class will never see
  36  * a content model with PCDATA in it. Any model with PCDATA is 'mixed'
  37  * and is handled via the MixedContentModel class since mixed models
  38  * are very constrained in form and easily handled via a special case.
  39  * This also makes implementation of this class much easier.
  40  *
  41  * @xerces.internal
  42  *
  43  * @LastModified: Oct 2017
  44  */
  45 public class DFAContentModel
  46     implements ContentModelValidator {
  47 
  48     //
  49     // Constants
  50     //
  51     // special strings
  52 
  53     /** Epsilon string. */
  54     private static String fEpsilonString = "<<CMNODE_EPSILON>>";
  55 
  56     /** End-of-content string. */
  57     private static String fEOCString = "<<CMNODE_EOC>>";
  58 
  59     /** initializing static members **/
  60     static {
  61         fEpsilonString = fEpsilonString.intern();
  62         fEOCString = fEOCString.intern();
  63     }


< prev index next >