1 /**
2  * Copyright 2006-2013 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package org.objenesis.strategy;
17 
18 /**
19  * Base {@link InstantiatorStrategy} class basically containing helpful constant to sort out JVMs.
20  *
21  * @author Henri Tremblay
22  */
23 public abstract class BaseInstantiatorStrategy implements InstantiatorStrategy {
24 
25    /** JVM_NAME prefix for JRockit */
26    protected static final String JROCKIT = "BEA";
27 
28    /** JVM_NAME prefix for GCJ */
29    protected static final String GNU = "GNU libgcj";
30 
31    /** JVM_NAME prefix for Sun Java HotSpot */
32    protected static final String SUN = "Java HotSpot";
33 
34    /** JVM_NAME prefix for Aonix PERC */
35    protected static final String PERC = "PERC";
36 
37    /** JVM_NAME prefix for Dalvik/Android */
38    protected static final String DALVIK = "Dalvik";
39 
40    /** JVM version */
41    protected static final String VM_VERSION = System.getProperty("java.runtime.version");
42 
43    /** JVM version */
44    protected static final String VM_INFO = System.getProperty("java.vm.info");
45 
46    /** Vendor version */
47    protected static final String VENDOR_VERSION = System.getProperty("java.vm.version");
48 
49    /** Vendor name */
50    protected static final String VENDOR = System.getProperty("java.vm.vendor");
51 
52    /** JVM name */
53    protected static final String JVM_NAME = System.getProperty("java.vm.name");
54 }
55