JClass amClass = new JClass(MAPPING_ACCESS_MODE);
JMethod getAccessMode = new JMethod("getAccessMode", amClass,
"the access mode specified for this class.");
if (_config.useJava50()) {
getAccessMode.addAnnotation(new JAnnotation(new JAnnotationType("Override")));
}
jsc = getAccessMode.getSourceCode();
jsc.add("return null;");
addMethod(getAccessMode);
//-- create getIdentity method
JMethod getIdentity = new JMethod("getIdentity", FIELD_DESCRIPTOR_CLASS,
"the identity field, null if this class has no identity.");
if (_config.useJava50()) {
getIdentity.addAnnotation(new JAnnotation(new JAnnotationType("Override")));
}
jsc = getIdentity.getSourceCode();
if (extended) {
jsc.add("if (_identity == null) {");
jsc.indent();
jsc.add("return super.getIdentity();");
jsc.unindent();
jsc.add("}");
}
jsc.add("return _identity;");
//--don't add the type to the import list
addMethod(getIdentity, false);
//-- create getJavaClass method
JMethod getJavaClass = new JMethod("getJavaClass", SGTypes.CLASS,
"the Java class represented by this descriptor.");
if (_config.useJava50()) {
getJavaClass.addAnnotation(new JAnnotation(new JAnnotationType("Override")));
}
jsc = getJavaClass.getSourceCode();
jsc.add("return ");
jsc.append(classType(_type));