org.jboss.errai.codegen.meta.MetaClass.asClass()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(133)

本文整理了Java中org.jboss.errai.codegen.meta.MetaClass.asClass()方法的一些代码示例,展示了MetaClass.asClass()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MetaClass.asClass()方法的具体详情如下:
包路径:org.jboss.errai.codegen.meta.MetaClass
类名称:MetaClass
方法名:asClass

MetaClass.asClass介绍

暂无

代码示例

代码示例来源:origin: errai/errai

@SuppressWarnings("unchecked")
public Class<Object> getTypeHandled() {
 return (Class<Object>) arrayType.asClass();
}

代码示例来源:origin: errai/errai

private boolean isTopLevel(final MetaClass type) {
 boolean isTopLevel;
 // Workaround for http://bugs.java.com/view_bug.do?bug_id=2210448
 try {
  isTopLevel = (type.asClass() == null || type.asClass().getDeclaringClass() == null);
 } catch (final IncompatibleClassChangeError ex) {
  isTopLevel = false;
 }
 return isTopLevel;
}

代码示例来源:origin: errai/errai

public static boolean canConvert(final MetaClass to, final MetaClass from) {
 try {
  final Class<?> fromClazz = from.asClass();
  final Class<?> toClass = to.asClass();
  return DataConversion.canConvert(toClass, fromClazz);
 }
 catch (final Throwable t) {
  return false;
 }
}

代码示例来源:origin: org.jboss.errai/errai-codegen

public static Class<?>[] asClassArray(final MetaType[] cls) {
 final Class<?>[] newClasses = new Class<?>[cls.length];
 for (int i = 0; i < cls.length; i++) {
  if (cls[i] instanceof MetaParameterizedType) {
   newClasses[i] = ((MetaClass) ((MetaParameterizedType) cls[i]).getRawType()).asClass();
  }
  else {
   newClasses[i] = ((MetaClass) cls[i]).asClass();
  }
 }
 return newClasses;
}

代码示例来源:origin: errai/errai

public static Class<?>[] asClassArray(final MetaType[] cls) {
 final Class<?>[] newClasses = new Class<?>[cls.length];
 for (int i = 0; i < cls.length; i++) {
  if (cls[i] instanceof MetaParameterizedType) {
   newClasses[i] = ((MetaClass) ((MetaParameterizedType) cls[i]).getRawType()).asClass();
  }
  else {
   newClasses[i] = ((MetaClass) cls[i]).asClass();
  }
 }
 return newClasses;
}

代码示例来源:origin: org.jboss.errai/errai-codegen

public static boolean canConvert(final MetaClass to, final MetaClass from) {
 try {
  final Class<?> fromClazz = from.asClass();
  final Class<?> toClass = to.asClass();
  return DataConversion.canConvert(toClass, fromClazz);
 }
 catch (final Throwable t) {
  return false;
 }
}

代码示例来源:origin: errai/errai

@Override
public Object convertFrom(final Object in) {
 if (MetaClass.class.isAssignableFrom(in.getClass())) {
  return ((MetaClass) in).asClass();
 }
 else {
  throw new RuntimeException("cannot convert from " + in.getClass() + "; to " + Class.class.getName());
 }
}

代码示例来源:origin: org.jboss.errai/errai-codegen

@Override
public Object convertFrom(final Object in) {
 if (MetaClass.class.isAssignableFrom(in.getClass())) {
  return ((MetaClass) in).asClass();
 }
 else {
  throw new RuntimeException("cannot convert from " + in.getClass() + "; to " + Class.class.getName());
 }
}

代码示例来源:origin: errai/errai

@SuppressWarnings("unchecked")
//@Override
private Class<Object> getTypeHandled() {
 return (Class<Object>) definition.getMappingClass().asClass();
}

代码示例来源:origin: errai/errai

@Override
 public Object[] getEmptyArray() {
  return (Object[]) Array.newInstance(arrayType.getOuterComponentType().asClass(), 0);
 }
}

代码示例来源:origin: org.jboss.errai/errai-marshalling

@SuppressWarnings("unchecked")
//@Override
private Class<Object> getTypeHandled() {
 return (Class<Object>) definition.getMappingClass().asClass();
}

代码示例来源:origin: org.jboss.errai/errai-marshalling

@Override
 public Object[] getEmptyArray() {
  return (Object[]) Array.newInstance(arrayType.getOuterComponentType().asClass(), 0);
 }
}

代码示例来源:origin: errai/errai

private void setStandaloneInterceptors(final Collection<MetaClass> standaloneInterceptors) {
 for (final MetaClass interceptorClass : standaloneInterceptors) {
  final InterceptsRemoteCall interceptor = interceptorClass.getAnnotation(InterceptsRemoteCall.class);
  final Class<?>[] intercepts = interceptor.value();
  for (final Class<?> intercept : intercepts) {
   this.standaloneInterceptors.put(intercept, interceptorClass.asClass());
  }
 }
}

代码示例来源:origin: org.jboss.errai/errai-ui

static Collection<String> elemental2ElementTags(final MetaClass type) {
 final Collection<String> customElementTags = customElementTags(type);
 if (!customElementTags.isEmpty()) {
  return customElementTags;
 }
 return Elemental2TagMapping.getTags(type.asClass());
}

代码示例来源:origin: org.jboss.errai/errai-codegen

private void setFeatureInterceptors(final Collection<MetaClass> featureInterceptors) {
 for (final MetaClass featureInterceptor : featureInterceptors) {
  final Class<? extends Annotation>[] annotations =
    featureInterceptor.getAnnotation(FeatureInterceptor.class).value();
  for (int i = 0; i < annotations.length; i++) {
   this.featureInterceptors.put(annotations[i], featureInterceptor.asClass());
  }
 }
}

代码示例来源:origin: errai/errai

static Collection<String> elemental2ElementTags(final MetaClass type) {
 final Collection<String> customElementTags = customElementTags(type);
 if (!customElementTags.isEmpty()) {
  return customElementTags;
 }
 return Elemental2TagMapping.getTags(type.asClass());
}

代码示例来源:origin: errai/errai

private void setFeatureInterceptors(final Collection<MetaClass> featureInterceptors) {
 for (final MetaClass featureInterceptor : featureInterceptors) {
  final Class<? extends Annotation>[] annotations =
    featureInterceptor.getAnnotation(FeatureInterceptor.class).value();
  for (int i = 0; i < annotations.length; i++) {
   this.featureInterceptors.put(annotations[i], featureInterceptor.asClass());
  }
 }
}

代码示例来源:origin: errai/errai

public static void assertIsIterable(final Statement statement) {
 final Class<?> cls = statement.getType().asClass();
 if (!cls.isArray() && !Iterable.class.isAssignableFrom(cls))
  throw new TypeNotIterableException(statement.generate(Context.create()));
}

代码示例来源:origin: errai/errai

@Override
public MetaClass getType() {
 Class<?> lhsType = null;
 if (lhs != null) {
  lhsType = lhs.getType().asUnboxed().asClass();
 }
 Class<?> rhsType = null;
 if (rhs != null) {
  rhsType = rhs.getType().asUnboxed().asClass();
 }
 return MetaClassFactory.get(promote(lhsType, rhsType));
}

代码示例来源:origin: errai/errai

@Override
public MetaClass getType() {
 Class<?> lhsType = null;
 if (lhs != null) {
  lhsType = lhs.getType().asUnboxed().asClass();
 }
 Class<?> rhsType = null;
 if (rhs != null) {
  rhsType = rhs.getType().asUnboxed().asClass();
 }
 return MetaClassFactory.get(promote(lhsType, rhsType));
}

相关文章