@SuppressWarnings("PMD.EmptyCatchBlock") public static <T extends Enum<T>> ImmutableList<String> getThriftDocumentation(Enum<T> enumConstant) { try { Field f = enumConstant.getDeclaringClass().getField(enumConstant.name()); return getThriftDocumentation(f); } catch (ReflectiveOperationException e) { // ignore } return ImmutableList.<String>of(); }
@SuppressWarnings("PMD.EmptyCatchBlock") public static <T extends Enum<T>> ImmutableList<String> getThriftDocumentation(Enum<T> enumConstant) { try { Field f = enumConstant.getDeclaringClass().getField(enumConstant.name()); return getThriftDocumentation(f); } catch (ReflectiveOperationException e) { // ignore } return ImmutableList.<String>of(); }
if (extraction.get() instanceof ThriftFieldExtractor) { ThriftFieldExtractor e = (ThriftFieldExtractor)extraction.get(); this.documentation = ThriftCatalog.getThriftDocumentation(e.getField()); } else if (extraction.get() instanceof ThriftMethodExtractor) { ThriftMethodExtractor e = (ThriftMethodExtractor)extraction.get(); this.documentation = ThriftCatalog.getThriftDocumentation(e.getMethod());
elementDocs.put(enumConstant, ThriftCatalog.getThriftDocumentation(enumConstant)); byEnumConstant = null; for (T enumConstant : enumClass.getEnumConstants()) { elementDocs.put(enumConstant, ThriftCatalog.getThriftDocumentation(enumConstant)); this.documentation = ThriftCatalog.getThriftDocumentation(enumClass);
elementDocs.put(enumConstant, ThriftCatalog.getThriftDocumentation(enumConstant)); byEnumConstant = null; for (T enumConstant : enumClass.getEnumConstants()) { elementDocs.put(enumConstant, ThriftCatalog.getThriftDocumentation(enumConstant)); this.documentation = ThriftCatalog.getThriftDocumentation(enumClass);
if (extraction.get() instanceof ThriftFieldExtractor) { ThriftFieldExtractor e = (ThriftFieldExtractor)extraction.get(); this.documentation = ThriftCatalog.getThriftDocumentation(e.getField()); } else if (extraction.get() instanceof ThriftMethodExtractor) { ThriftMethodExtractor e = (ThriftMethodExtractor)extraction.get(); this.documentation = ThriftCatalog.getThriftDocumentation(e.getMethod());
protected AbstractThriftMetadataBuilder(ThriftCatalog catalog, Type structType) { this.catalog = checkNotNull(catalog, "catalog is null"); this.structType = checkNotNull(structType, "structType is null"); this.metadataErrors = new MetadataErrors(catalog.getMonitor()); // assign the struct name from the annotation or from the Java class structName = extractName(); // get the builder type from the annotation or from the Java class builderType = extractBuilderType(); // grab any documentation from the annotation or saved JavaDocs documentation = ThriftCatalog.getThriftDocumentation(getStructClass()); // extract all of the annotated constructor and report an error if // there is more than one or none // also extract thrift fields from the annotated parameters and verify extractFromConstructors(); // extract thrift fields from the annotated fields and verify extractFromFields(); // extract thrift fields from the annotated methods (and parameters) and verify extractFromMethods(); }
protected AbstractThriftMetadataBuilder(ThriftCatalog catalog, Type structType) { this.catalog = checkNotNull(catalog, "catalog is null"); this.structType = checkNotNull(structType, "structType is null"); this.metadataErrors = new MetadataErrors(catalog.getMonitor()); // assign the struct name from the annotation or from the Java class structName = extractName(); // get the builder type from the annotation or from the Java class builderType = extractBuilderType(); // grab any documentation from the annotation or saved JavaDocs documentation = ThriftCatalog.getThriftDocumentation(getStructClass()); // extract all of the annotated constructor and report an error if // there is more than one or none // also extract thrift fields from the annotated parameters and verify extractFromConstructors(); // extract thrift fields from the annotated fields and verify extractFromFields(); // extract thrift fields from the annotated methods (and parameters) and verify extractFromMethods(); }