Exemplo n.º 1
0
  private CustomType getCustomType(IJstNode jstNode) {
    if (jstNode == null) {
      return null;
    }
    MetaProvider metaProvider = (MetaProvider) getMetaProvider();
    IJstType ownerType = jstNode.getOwnerType();
    CustomType cType = metaProvider.getCustomType(ownerType.getName());

    if (cType == null) {
      cType = new CustomType(ownerType.getName());
      metaProvider.addCustomType(ownerType.getName(), cType);
    }

    return cType;
  }
Exemplo n.º 2
0
  public boolean isSerializableForVjo(IJstType type, boolean isRoot) {
    boolean ret = false;
    if (type == null) return false;

    if (isRoot) {
      if (getJavaTypeForSerialable(type) != null) {
        return true;
      }
    }

    if (isJavaPrimitiveOrWrapper(type.getName()) || type.isEnum()) {
      return false;
    }

    String forName = ISerializableForVjo.class.getName();
    if (type.isInterface()) {
      // Check extends of Interface
      if (type.getName().equals(forName)) {
        return true;
      }
    } else {
      if (type.getName().equals(forName)) {
        return true;
      }
      // Check interfaces of the class
      for (IJstType iType : type.getSatisfies()) {
        if (iType.getName().equals(forName)) {
          return true;
        }
        ret = isSerializableForVjo(iType, false);
        if (ret) return ret;
      }
    }
    for (IJstType eType : type.getExtends()) {
      ret = isSerializableForVjo(eType, false);
      if (ret) return ret;
    }

    return false;
  }
Exemplo n.º 3
0
 public Class<?> getJavaTypeForSerialable(IJstType type) {
   return s_javaSerializable.get(type.getName());
 }
Exemplo n.º 4
0
 public boolean isSkipImportJsr(IJstType jstType) {
   String name = jstType.getName();
   return s_excludeList.contains(name);
 }
Exemplo n.º 5
0
 public boolean isSkipExtends(IJstType jstType) {
   return (s_extends.contains(jstType.getName()));
 }
Exemplo n.º 6
0
 public boolean isSkipSatisfies(IJstType jstType) {
   return (s_satisfies.contains(jstType.getName()));
 }
Exemplo n.º 7
0
 public boolean isSkipImport(IJstType jstType) {
   String name = normalize(jstType.getName());
   return isJavaPrimitiveOrWrapper(name) || isJavaLang(name);
 }