private static ProjectdocMetaData createTypeMetadata(final Class<?> type, final Defaults defaults) { final ProjectdocMetaData metadata = new ProjectdocMetaData(); provideDefaults(defaults, metadata); for (final Annotation annotation : type.getAnnotations()) { addMetadata(metadata, annotation); } return metadata; }
/** * Parses the comments for the given descriptor. * <p> * This method is overridden by subclasses to return their specific * implementation of the {@link DocumentMetaData}. * </p> * * @param descriptor the descriptor whose comments are requested to be parsed. * @param locale the locale to select the comments. * @return the comments for the given locale or the default comments, if the * locale is not supported. May be <code>null</code> if no information * is provided. */ @CheckForNull public ProjectdocMetaData parse(final PropertyDescriptor descriptor, final Locale locale) { try { final ProjectdocMetaData metaData = new ProjectdocMetaData(); parseBase(descriptor, locale, metaData); return metaData; } catch (final MetaDataException e) { LOG.warn("Cannot parse meta data for property descriptor '{}': {}", descriptor, e); return null; } }
/** * Adds annotations of the given element. * * @param element the element whose annotations are to be fetched. * @return the document instance meta data for the given {@code element}. */ @Override public ProjectdocMetaData createMetaDataFromAnnotations(final Method element) { final ProjectdocMetaData metadata = new ProjectdocMetaData(parentMetadata); setDefaults(element, metadata); for (final Annotation annotation : element.getAnnotations()) { addMetadata(metadata, annotation); } return metadata; }