com.sun.tools.xjc.model.nav.EagerNClass Maven / Gradle / Ivy
Go to download
Old JAXB Binding Compiler. Contains source code needed for binding customization files into java sources.
In other words: the *tool* to generate java classes for the given xml representation.
package com.sun.tools.xjc.model.nav;
import java.lang.reflect.Modifier;
import java.util.HashSet;
import java.util.Set;
import com.sun.codemodel.JClass;
import com.sun.tools.xjc.outline.Aspect;
import com.sun.tools.xjc.outline.Outline;
/**
* @author Kohsuke Kawaguchi
*/
public class EagerNClass extends EagerNType implements NClass {
/*package*/ final Class c;
public EagerNClass(Class type) {
super(type);
this.c = type;
}
@Override
public boolean isBoxedType() {
return boxedTypes.contains(c);
}
@Override
public JClass toType(Outline o, Aspect aspect) {
return o.getCodeModel().ref(c);
}
public boolean isAbstract() {
return Modifier.isAbstract(c.getModifiers());
}
private static final Set boxedTypes = new HashSet();
static {
boxedTypes.add(Boolean.class);
boxedTypes.add(Character.class);
boxedTypes.add(Byte.class);
boxedTypes.add(Short.class);
boxedTypes.add(Integer.class);
boxedTypes.add(Long.class);
boxedTypes.add(Float.class);
boxedTypes.add(Double.class);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy