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

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

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

MetaClass.getFullyQualifiedName介绍

暂无

代码示例

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

public ClassStructureBuilder<?> generate() {
 final String safeProxyClassName = remote.getFullyQualifiedName().replace('.', '_') + "Impl";
 final ClassStructureBuilder<?> classBuilder =
  ClassBuilder.define(safeProxyClassName, AbstractRpcProxy.class)
   .packageScope()
   .implementsInterface(remote)
   .body();
 for (final MetaMethod method : remote.getMethods()) {
  if (ProxyUtil.shouldProxyMethod(method)) {
   generateMethod(classBuilder, method);
  }
 }
 return classBuilder;
}

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

public UndefinedFieldException(String fieldName, MetaClass declaringClass) {
 this("could not resolve field: " + fieldName + "; in class: " + declaringClass.getFullyQualifiedName());
 this.fieldName = fieldName;
 this.declaringClass = declaringClass;
}

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

/**
  * Using the given composite {@link Template} type, return the name of the map
  * of {@link DataField} names and variable {@link MetaClass} types.
  */
 private static final String dataFieldAnnotationMapName(final MetaClass composite) {
  return DataFieldCodeDecorator.class.getName() + "_DATA_FIELD_ANNOTATION_MAP_" + composite.getFullyQualifiedName();
 }
}

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

public static String getMarshallerImplClassName(final MetaClass type, final boolean gwtTarget) {
 String implName = leasedNamesByTypeName.get(type.getFullyQualifiedName());
 if (implName == null) {
  implName = generateMarshallerImplClassName(type, gwtTarget);
  leasedNamesByTypeName.put(type.getFullyQualifiedName(), implName);
 }
 return implName;
}

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

public static String getMarshallerImplClassName(final MetaClass type, final boolean gwtTarget) {
 String implName = leasedNamesByTypeName.get(type.getFullyQualifiedName());
 if (implName == null) {
  implName = generateMarshallerImplClassName(type, gwtTarget);
  leasedNamesByTypeName.put(type.getFullyQualifiedName(), implName);
 }
 return implName;
}

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

@Override
public String toString() {
 StringBuilder sbuf = new StringBuilder();
 sbuf.append(super.toString());
 sbuf.append(" - field ").append(field)
     .append(" could not be satisfied for type: ").append(injectedType.getFullyQualifiedName()).append("\n");
 if (message.length() > 0) {
  sbuf.append("  Message: ").append(message).append("\n");
 }
 return sbuf.toString();
}

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

public void pushCache(final String fqcn, final MetaClass clazz) {
 logger.trace("Creating new " + clazz.getClass().getSimpleName() + " cache entry for " + fqcn);
 if (!PRIMARY_CLASS_CACHE.containsKey(fqcn)) {
  PRIMARY_CLASS_CACHE.put(fqcn, new CacheEntry(clazz, CacheEntry.PLACE_HOLDER));
  if (!backupClassCache.containsKey(clazz.getFullyQualifiedName())) {
   invalidated.add(fqcn);
  }
 }
}

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

@Override
public String toString() {
 StringBuilder sbuf = new StringBuilder();
 sbuf.append(super.toString());
 sbuf.append(" - parameter ").append(field.getName())
     .append(" could not be satisfied for type: ").append(injectedType.getFullyQualifiedName()).append("\n");
 if (message.length() > 0) {
  sbuf.append("  Message: ").append(message).append("\n");
 }
 return sbuf.toString();
}

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

private boolean isAlternativeEnabled(final MetaClass type) {
 if (alternatives == null) {
  final String userDefinedAlternatives = EnvUtil.getEnvironmentConfig().getFrameworkOrSystemProperty("errai.ioc.enabled.alternatives");
  if (userDefinedAlternatives != null) {
   alternatives = new HashSet<>(Arrays.asList(userDefinedAlternatives.split("\\s+")));
  } else {
   alternatives = Collections.emptyList();
  }
 }
 return alternatives.contains(type.getFullyQualifiedName());
}

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

private static boolean _hasInterface(final MetaClass[] from, final MetaClass to) {
 for (final MetaClass interfaceType : from) {
  if (to.getFullyQualifiedName().equals(interfaceType.getErased().getFullyQualifiedName()))
   return true;
  else if (_hasInterface(interfaceType.getInterfaces(), to))
   return true;
 }
 return false;
}

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

private Statement generateRequest(ClassStructureBuilder<?> classBuilder,
   MetaMethod method, Statement methodParams, boolean intercepted) {
  
  final Statement sendable = Stmt
      .invokeStatic(MessageBuilder.class, "createCall")
      .invoke("call", remote.getFullyQualifiedName())
      .invoke("endpoint", ProxyUtil.createCallSignature(method),
        Stmt.loadClassMember("qualifiers"),
        methodParams)
      .invoke("respondTo", method.getReturnType().asBoxed(), Stmt.loadVariable("remoteCallback"))
      .invoke("errorsHandledBy", Stmt.loadVariable("errorCallback"));

  final BlockStatement requestBlock = new BlockStatement();
  requestBlock.addStatement(Stmt.declareVariable("sendable", RemoteCallSendable.class, sendable));
  requestBlock.addStatement(Stmt.loadStatic(classBuilder.getClassDefinition(), "this")
    .invoke("sendRequest", Variable.get("bus"), Variable.get("sendable")));

  return requestBlock;
 }
}

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

@Override
public ClassDefinitionBuilderInterfaces<T> implementsInterface(final MetaClass clazz) {
 if (!clazz.isInterface()) {
  throw new RuntimeException("not an interface: " + clazz.getFullyQualifiedName());
 }
 classDefinition.addInterface(clazz);
 return this;
}

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

private Predicate<List<InjectableHandle>> getPathPredicate(final HasAnnotations annotated, final List<String> problems) {
 if (annotated.isAnnotationPresent(Typed.class)) {
  final Class<?>[] beanTypes = annotated.getAnnotation(Typed.class).value();
  validateAssignableTypes(annotated, beanTypes, problems);
  return path -> Object.class.getName().equals(path.get(0)) || Arrays.stream(beanTypes)
      .anyMatch(beanType -> path.get(0).getType().getFullyQualifiedName().equals(beanType.getName()));
 }
 else {
  return ANY;
 }
}

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

private void validateNonEmptyEventHandlerTargets(final MetaClass declaringClass, final MetaMethod method, final String[] targetDataFieldNames) {
 if (targetDataFieldNames.length == 0) {
  throw new GenerationException("@EventHandler annotation on method ["
    + declaringClass.getFullyQualifiedName()
    + "." + method.getName() + "] must specify at least one data-field target.");
 }
}

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

@Override
public boolean isDefaultInstantiableSubtypeOf(final String fqcn) {
 if (!isPublic() || !isDefaultInstantiable()) {
  return false;
 }
 MetaClass type = this;
 while (type != null && !type.getFullyQualifiedName().equals(fqcn)) {
  type = type.getSuperClass();
 }
 return type != null;
}

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

public boolean isWhitelisted(final MetaClass type) {
 if (whitelist.isEmpty()) {
  return true;
 }
 final SimplePackageFilter implicitFilter = new SimplePackageFilter(Arrays.asList(implicitWhitelist));
 final SimplePackageFilter whitelistFilter = new SimplePackageFilter(whitelist);
 final String fullName = type.getFullyQualifiedName();
 return implicitFilter.apply(fullName) || whitelistFilter.apply(fullName);
}

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

public String getCanonicalString(final Context context) {
 if (context == null) {
  return getValue().getFullyQualifiedName() + ".class";
 }
 else {
  return getClassReference(getValue(), context, false) + ".class";
 }
}

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

public void addOrMarkMarshallerUnlazy(final MetaClass type) {
 final MappingDefinition definition = mappingContext.getDefinitionsFactory().getDefinition(type);
 if (definition == null) {
  unlazyMarshallers.add(type.getFullyQualifiedName());
 }
 else if (definition.isLazy()) {
  definition.setLazy(false);
  addMarshaller(type);
 }
}

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

public static ClassStructureBuilder<?> implement(final MetaClass cls) {
 return new ClassBuilder<DefaultClassStructureBuilder>(cls.getFullyQualifiedName() + "Impl", null, Context.create()
     .autoImport())
     .publicScope()
     .implementsInterface(cls).body();
}

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

public void marshallEnum(final ContextualStatementBuilder bb,
             final Statement valueStatement,
             final MetaClass toType) {
 final Implementations.StringBuilderBuilder internalSBB = Implementations.newStringBuilder()
     .append("{\"").append(SerializationParts.ENCODED_TYPE)
     .append( "\":\"").append( toType.getFullyQualifiedName()).append("\",\"")
     .append(SerializationParts.ENUM_STRING_VALUE).append("\":\"")
     .append(Stmt.nestedCall(valueStatement).invoke("name")).append("\"}");
 final TernaryStatement ternaryStatement = new TernaryStatement(
   Bool.isNotNull(valueStatement), internalSBB, Stmt.load("null"));
 bb.invoke("append", ternaryStatement);
}

相关文章