< prev index next >
src/java.xml/share/classes/com/sun/xml/internal/stream/dtd/nonvalidating/DTDGrammar.java
Print this page
*** 1,15 ****
/*
! * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
*/
/*
! * Copyright 2005 The Apache Software Foundation.
! *
! * Licensed under the Apache License, Version 2.0 (the "License");
! * you may not use this file except in compliance with the License.
! * You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
--- 1,16 ----
/*
! * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
*/
/*
! * Licensed to the Apache Software Foundation (ASF) under one or more
! * contributor license agreements. See the NOTICE file distributed with
! * this work for additional information regarding copyright ownership.
! * The ASF licenses this file to You under the Apache License, Version 2.0
! * (the "License"); you may not use this file except in compliance with
! * the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
*** 32,42 ****
import com.sun.org.apache.xerces.internal.xni.parser.XMLDTDSource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
- import java.util.Random;
/**
* A DTD grammar. This class implements the XNI handler interfaces
* for DTD information so that it can build the approprate validation
* structures automatically from the callbacks.
--- 33,42 ----
*** 93,104 ****
/** fReadingExternalDTD */
protected boolean fReadingExternalDTD = false;
/** Symbol table. */
! private SymbolTable fSymbolTable;
! private ArrayList notationDecls = new ArrayList();
// element declarations
/** Number of element declarations. */
private int fElementDeclCount = 0;
--- 93,104 ----
/** fReadingExternalDTD */
protected boolean fReadingExternalDTD = false;
/** Symbol table. */
! private final SymbolTable fSymbolTable;
! private final ArrayList<XMLNotationDecl> notationDecls = new ArrayList<>();
// element declarations
/** Number of element declarations. */
private int fElementDeclCount = 0;
*** 332,353 ****
fCurrentAttributeIndex = createAttributeDecl();// Create current Attribute Decl
fSimpleType.clear();
if ( defaultType != null ) {
if ( defaultType.equals( "#FIXED") ) {
! fSimpleType.defaultType = fSimpleType.DEFAULT_TYPE_FIXED;
} else if ( defaultType.equals( "#IMPLIED") ) {
! fSimpleType.defaultType = fSimpleType.DEFAULT_TYPE_IMPLIED;
} else if ( defaultType.equals( "#REQUIRED") ) {
! fSimpleType.defaultType = fSimpleType.DEFAULT_TYPE_REQUIRED;
}
}
if ( DEBUG ) {
System.out.println("defaultvalue = " + defaultValue.toString() );
}
fSimpleType.defaultValue = defaultValue!=null ? defaultValue.toString() : null;
! fSimpleType.nonNormalizedDefaultValue = nonNormalizedDefaultValue!=null ? nonNormalizedDefaultValue.toString() : null;
fSimpleType.enumeration = enumeration;
if (type.equals("CDATA")) {
fSimpleType.type = XMLSimpleType.TYPE_CDATA;
}
--- 332,354 ----
fCurrentAttributeIndex = createAttributeDecl();// Create current Attribute Decl
fSimpleType.clear();
if ( defaultType != null ) {
if ( defaultType.equals( "#FIXED") ) {
! fSimpleType.defaultType = XMLSimpleType.DEFAULT_TYPE_FIXED;
} else if ( defaultType.equals( "#IMPLIED") ) {
! fSimpleType.defaultType = XMLSimpleType.DEFAULT_TYPE_IMPLIED;
} else if ( defaultType.equals( "#REQUIRED") ) {
! fSimpleType.defaultType = XMLSimpleType.DEFAULT_TYPE_REQUIRED;
}
}
if ( DEBUG ) {
System.out.println("defaultvalue = " + defaultValue.toString() );
}
fSimpleType.defaultValue = defaultValue!=null ? defaultValue.toString() : null;
! fSimpleType.nonNormalizedDefaultValue = nonNormalizedDefaultValue!=null ?
! nonNormalizedDefaultValue.toString() : null;
fSimpleType.enumeration = enumeration;
if (type.equals("CDATA")) {
fSimpleType.type = XMLSimpleType.TYPE_CDATA;
}
*** 729,739 ****
notationDecl.setValues(name,identifier.getPublicId(),identifier.getLiteralSystemId(),
identifier.getBaseSystemId());
notationDecls.add(notationDecl);
}
! public List getNotationDecls(){
return notationDecls;
}
//
// Private methods
--- 730,740 ----
notationDecl.setValues(name,identifier.getPublicId(),identifier.getLiteralSystemId(),
identifier.getBaseSystemId());
notationDecls.add(notationDecl);
}
! public List<XMLNotationDecl> getNotationDecls() {
return notationDecls;
}
//
// Private methods
< prev index next >