Package com.citytechinc.cq.component.maven.util

Examples of com.citytechinc.cq.component.maven.util.LogSingleton


  private final Map<Class<?>, WidgetConfigHolder> annotationToWidgetConfigMap;

  public DefaultWidgetRegistry(ClassPool classPool, ClassLoader classLoader, Reflections reflections)
    throws MalformedURLException, ClassNotFoundException, NotFoundException {

    LogSingleton LOG = LogSingleton.getInstance();

    List<WidgetConfigHolder> widgetConfigs = ComponentMojoUtil.getAllWidgetAnnotations(classPool, classLoader,
      reflections);

    LOG.debug(widgetConfigs.size() + " Widget Configurations found");

    this.annotationToWidgetConfigMap = new HashMap<Class<?>, WidgetConfigHolder>();

    for (WidgetConfigHolder curConfig : widgetConfigs) {
      LOG.debug("Widget Config -- " + curConfig.getWidgetClass() + " : " + curConfig.getMakerClass() + " : "
        + curConfig.getAnnotationClass() + " : " + curConfig.getXtype());
      if (curConfig.getAnnotationClass() != null) {
        this.annotationToWidgetConfigMap.put(curConfig.getAnnotationClass(), curConfig);
      }
    }
View Full Code Here


  }

  public static WidgetConfigHolder getWidgetConfig(WidgetMakerParameters parameters, int rankCeiling)
    throws ClassNotFoundException {

    LogSingleton LOG = LogSingleton.getInstance();

    WidgetConfigHolder highestRankedWidget = null;

    Set<Class<?>> registeredAnnotations = parameters.getWidgetRegistry().getRegisteredAnnotations();

    for (Class<?> curRegisteredAnnotation : registeredAnnotations) {
      LOG.debug("Checking for known annotation " + curRegisteredAnnotation);
      if (parameters.getCtMember().hasAnnotation(curRegisteredAnnotation)) {
        WidgetConfigHolder curPotential = parameters.getWidgetRegistry().getWidgetForAnnotation(
          curRegisteredAnnotation);
        if (rankCeiling < 0 || curPotential.getRanking() < rankCeiling) {
          LOG.debug("Match found in the registry with ranking " + curPotential.getRanking());
          if (highestRankedWidget == null || curPotential.getRanking() > highestRankedWidget.getRanking()) {
            highestRankedWidget = curPotential;
          }
        }
      }
View Full Code Here

TOP

Related Classes of com.citytechinc.cq.component.maven.util.LogSingleton

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.