org.apache.xmlbeans.impl.jam.internal.elements.PrimitiveClassImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of com.liferay.dynamic.data.mapping.service Show documentation
Show all versions of com.liferay.dynamic.data.mapping.service Show documentation
Liferay Dynamic Data Mapping Service
The newest version!
/* Copyright 2004 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,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.xmlbeans.impl.jam.internal.elements;
import org.apache.xmlbeans.impl.jam.JClass;
import java.util.HashMap;
import java.util.Map;
/**
* JClass implementation for primitive types.
*
* @author Patrick Calahan <email: pcal-at-bea-dot-com>
*/
public final class PrimitiveClassImpl extends BuiltinClassImpl {
// ========================================================================
// Constants
private static final Object[][] PRIMITIVES = {
// Name FD Class
{"int", "I", int.class},
{"long", "J", long.class},
{"boolean", "Z", boolean.class},
{"short", "S", short.class},
{"byte", "B", byte.class},
{"char", "C", char.class},
{"float", "F", float.class},
{"double", "D", double.class},
};
private static final Map NAME_TO_FD, NAME_TO_CLASS;
static {
NAME_TO_FD = new HashMap();
NAME_TO_CLASS = new HashMap();
for (int i = 0; i < PRIMITIVES.length; i++) {
NAME_TO_FD.put(PRIMITIVES[i][0],PRIMITIVES[i][1]);
NAME_TO_CLASS.put(PRIMITIVES[i][0],PRIMITIVES[i][2]);
}
};
// ========================================================================
// Factory methods
public static void mapNameToPrimitive(ElementContext ctx, Map out) {
for(int i=0; i
© 2015 - 2025 Weber Informatics LLC | Privacy Policy