/** * REVIEW: I'm not sure why we do two passes here. * * <p> * Perhaps it's important to skip helpers first. I doubt it, though. */ private List<FacetedMethod> findActionFacetedMethods(final MethodScope methodScope) { if (LOG.isDebugEnabled()) { LOG.debug("introspecting " + getClassName() + ": actions"); } final List<FacetedMethod> actionFacetedMethods1 = findActionFacetedMethods(methodScope, RecognisedHelpersStrategy.SKIP); final List<FacetedMethod> actionFacetedMethods2 = findActionFacetedMethods(methodScope, RecognisedHelpersStrategy.DONT_SKIP); return ListUtils.combine(actionFacetedMethods1, actionFacetedMethods2); }
@Override public String toString() { final ToString str = new ToString(this); str.append("class", getClassName()); return str.toString(); }
private List<FacetedMethod> createAssociationFacetedMethods() { if (LOG.isDebugEnabled()) { LOG.debug("introspecting " + getClassName() + ": properties and collections"); } final Set<Method> associationCandidateMethods = getFacetProcessor().findAssociationCandidateAccessors(methods, new HashSet<Method>()); // Ensure all return types are known final List<Class<?>> typesToLoad = Lists.newArrayList(); for (final Method method : associationCandidateMethods) { getSpecificationTraverser().traverseTypes(method, typesToLoad); } getSpecificationLoader().loadSpecifications(typesToLoad, introspectedClass); // now create FacetedMethods for collections and for properties final List<FacetedMethod> associationFacetedMethods = Lists.newArrayList(); findAndRemoveCollectionAccessorsAndCreateCorrespondingFacetedMethods(associationFacetedMethods); findAndRemovePropertyAccessorsAndCreateCorrespondingFacetedMethods(associationFacetedMethods); return Collections.unmodifiableList(associationFacetedMethods); }
public void introspectClass() { LOG.info("introspecting " + getClassName()); if (LOG.isDebugEnabled()) { LOG.debug("introspecting " + getClassName() + ": class-level details"); } // process facets at object level // this will also remove some methods, such as the superclass methods. getFacetProcessor().process(introspectedClass, methodRemover, spec); // if this class has additional facets (as per @Facets), then process // them. final FacetsFacet facetsFacet = spec.getFacet(FacetsFacet.class); if (facetsFacet != null) { final Class<? extends FacetFactory>[] facetFactories = facetsFacet.facetFactories(); for (final Class<? extends FacetFactory> facetFactorie : facetFactories) { FacetFactory facetFactory = null; try { facetFactory = facetFactorie.newInstance(); } catch (final InstantiationException e) { throw new IsisException(e); } catch (final IllegalAccessException e) { throw new IsisException(e); } getFacetProcessor().injectDependenciesInto(facetFactory); facetFactory.process(new ProcessClassContext(introspectedClass, methodRemover, spec)); } } }