public String toString() { return fullName(); } }
public String toString() { return fullName(); } }
public String toString() { return fullName(); } }
public String toString() { return fullName(); } }
public String toString() { return fullName(); } }
@XmlID public String getName() { return fullName(); }
@XmlID public String getName() { return fullName(); }
@XmlID public String getName() { return fullName(); }
@XmlID public String getName() { return fullName(); }
@XmlID public String getName() { return fullName(); }
public ClassOutline getClassOutline(Outline outline, String fullName) { for (ClassOutline classOutline : outline.getClasses()) { if (classOutline.target.fullName().equals(fullName)) { return classOutline; } } return null; }
public boolean run(Outline model, Options opt, ErrorHandler errorHandler) throws SAXException { File javaFile = null; try { for(ClassOutline co : model.getClasses()) { javaFile = new File(opt.targetDir, co.target.fullName().replaceAll("\\.", "/") + ".java"); //System.out.println("simple_regenerator: [" //+ javaFile.getAbsolutePath() + "] " + (javaFile.canRead() ? "exists" : "non-existing")); if(!javaFile.canWrite()) continue; String preservedCode = getPreservedCode(javaFile); if(preservedCode != null) { System.out.println("simple_regenerator: preserved code in: [" + javaFile.getAbsolutePath() + "]"); co.implClass.direct(preservedCode); } } return true; } catch(Exception e) { errorHandler.error(new SAXParseException("Failed to write to "+ javaFile, null, e)); return false; } }
public String getEntityTableName(Mapping context, final CClass classInfo) { if (classInfo instanceof CClassInfo) { return getName(context, getTableName(((CClassInfo) classInfo).fullName())); } else if (classInfo instanceof CClassRef) { final String fullName = ((CClassRef) classInfo).fullName(); return getName(context, getTableName(fullName)); } else { throw new AssertionError("Unexpected type."); } }
public String getEntityTableName(Mapping context, final CClass classInfo) { if (classInfo instanceof CClassInfo) { return getName(context, getTableName(((CClassInfo) classInfo).fullName())); } else if (classInfo instanceof CClassRef) { final String fullName = ((CClassRef) classInfo).fullName(); return getName(context, getTableName(fullName)); } else { throw new AssertionError("Unexpected type."); } }
public static String getMethodName(ClassOutline classOutline, JFieldVar field, String prefix) { CPropertyInfo prop = classOutline.target.getProperty(field.name()); if (prop == null) { throw new IllegalStateException("No property info for classOutline=" + classOutline.target.fullName() + ", field=" + field.name()+" of " + field.type()); } return prefix + prop.getName(true); }
public Collection<? extends CTypeInfo> ref(C context, CPropertyInfo propertyInfo) { final Collection<? extends CTypeInfo> types = propertyInfo.ref(); final JType baseType = propertyInfo.baseType; final ID id = propertyInfo.id(); final CTypeInfo parent = propertyInfo.parent(); if (ID.IDREF.equals(id) && baseType != null) { if (parent instanceof CClassInfo) { final CClassInfo parentClassInfo = (CClassInfo) parent; final String fullName = baseType.fullName(); for (CClassInfo possibleClassInfo : parentClassInfo.model .beans().values()) { final String possibleFullName = possibleClassInfo .fullName(); if (fullName != null && fullName.equals(possibleFullName)) { return Collections.singleton(possibleClassInfo); } } } } return types; }
public Collection<? extends CTypeInfo> ref(C context, CPropertyInfo propertyInfo) { final Collection<? extends CTypeInfo> types = propertyInfo.ref(); final JType baseType = propertyInfo.baseType; final ID id = propertyInfo.id(); final CTypeInfo parent = propertyInfo.parent(); if (ID.IDREF.equals(id)) { if (parent instanceof CClassInfo) { final CClassInfo parentClassInfo = (CClassInfo) parent; final String fullName = baseType.fullName(); for (CClassInfo possibleClassInfo : parentClassInfo.model .beans().values()) { final String possibleFullName = possibleClassInfo .fullName(); if (fullName != null && fullName.equals(possibleFullName)) { return Collections.singleton(possibleClassInfo); } } } } return types; }
CClassInfo classInfo = (CClassInfo)type.getTarget(); JClass clazz = codeModel.ref(classInfo.fullName());