< prev index next >
src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/relaxng/DatatypeLib.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 23,32 ****
--- 23,33 ----
* questions.
*/
package com.sun.tools.internal.xjc.reader.relaxng;
+ import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import com.sun.tools.internal.xjc.model.CBuiltinLeafInfo;
import com.sun.tools.internal.xjc.model.TypeUse;
*** 42,56 ****
final class DatatypeLib {
/**
* Datatype library's namespace URI.
*/
public final String nsUri;
! private final Map<String,TypeUse> types = new HashMap<String,TypeUse>();
!
! public DatatypeLib(String nsUri) {
this.nsUri = nsUri;
}
/**
* Maps the type name to the information.
*/
--- 43,57 ----
final class DatatypeLib {
/**
* Datatype library's namespace URI.
*/
public final String nsUri;
+ private final Map<String,TypeUse> types;
! public DatatypeLib(String nsUri, Map<String,TypeUse> types) {
this.nsUri = nsUri;
+ this.types = Collections.unmodifiableMap(types);
}
/**
* Maps the type name to the information.
*/
*** 59,76 ****
}
/**
* Datatype library for the built-in type.
*/
! public static final DatatypeLib BUILTIN = new DatatypeLib("");
/**
* Datatype library for XML Schema datatypes.
*/
! public static final DatatypeLib XMLSCHEMA = new DatatypeLib(WellKnownNamespaces.XML_SCHEMA_DATATYPES);
static {
! BUILTIN.types.put("token",CBuiltinLeafInfo.TOKEN);
! BUILTIN.types.put("string",CBuiltinLeafInfo.STRING);
! XMLSCHEMA.types.putAll(SimpleTypeBuilder.builtinConversions);
}
}
--- 60,82 ----
}
/**
* Datatype library for the built-in type.
*/
! public static final DatatypeLib BUILTIN;
/**
* Datatype library for XML Schema datatypes.
*/
! public static final DatatypeLib XMLSCHEMA =
! new DatatypeLib(
! WellKnownNamespaces.XML_SCHEMA_DATATYPES,
! SimpleTypeBuilder.builtinConversions);
static {
! Map<String,TypeUse> builtinTypes = new HashMap<>();
! builtinTypes.put("token", CBuiltinLeafInfo.TOKEN);
! builtinTypes.put("string", CBuiltinLeafInfo.STRING);
!
! BUILTIN = new DatatypeLib("", builtinTypes);
}
}
< prev index next >