Package org.cruxframework.crux.core.rebind.screen.widget.declarative

Examples of org.cruxframework.crux.core.rebind.screen.widget.declarative.TagConstraints


        Class<? extends WidgetChildProcessor<?>> processorClass = child.value();
        if (!added.contains(processorClass.getCanonicalName()))
        {
          parentPath = parentWidget;
          added.add(processorClass.getCanonicalName());
          TagConstraints childAttributes = ViewUtils.getChildTagConstraintsAnnotation(processorClass);
          if (childAttributes!= null)
          {
            if (!StringUtils.isEmpty(childAttributes.tagName()))
            {
              parentPath = parentWidget+"_"+childAttributes.tagName();
              if (WidgetCreator.class.isAssignableFrom(childAttributes.type()))
              {
                DeclarativeFactory declarativeFactory = childAttributes.type().getAnnotation(DeclarativeFactory.class);
                if (declarativeFactory != null)
                {
                  referenceWidgetsList.put(parentLibrary+"_"+parentPath,
                      declarativeFactory.library()+"_"+declarativeFactory.id());
                }
              }
              else
              {
                widgetsSubTags.add(parentLibrary+"_"+parentPath);             
              }
            }
            if (HTMLTag.class.isAssignableFrom(childAttributes.type()))
            {
              hasInnerHTMLWidgetTags.add(parentLibrary+"_"+parentPath);
            }
          }
         
View Full Code Here


   * @param processorClass
   * @return
   */
  public static TagConstraints getChildTagConstraintsAnnotation(Class<?> processorClass)
  {
    TagConstraints attributes = processorClass.getAnnotation(TagConstraints.class);
    if (attributes == null)
    {
      Class<?> superClass = processorClass.getSuperclass();
      if (superClass != null && !superClass.equals(WidgetCreator.class))
      {
View Full Code Here

   * @throws NoSuchMethodException
   */
  private void generateChild(PrintStream out, TagChild tagChild, boolean parentIsAnAgregator, String library) throws SecurityException, NoSuchMethodException
  {
    Class<? extends WidgetChildProcessor<?>> processorClass = tagChild.value();
    TagConstraints attributes = ViewUtils.getChildTagConstraintsAnnotation(processorClass);
    TagChildren children = processorClass.getAnnotation(TagChildren.class);

    if (ChoiceChildProcessor.class.isAssignableFrom(processorClass))
    {
      generateChoiceChild(out, attributes, children, library)
View Full Code Here

   * @param processorClass
   * @return
   */
  public TagConstraints getChildtrenAttributesAnnotation(Class<?> processorClass)
  {
    TagConstraints attributes = processorClass.getAnnotation(TagConstraints.class);
    if (attributes == null)
    {
      Class<?> superClass = processorClass.getSuperclass();
      if (superClass != null && superClass.getSuperclass() != null)
      {
View Full Code Here

   */
  private void createChildProcessorForMultipleChildrenProcessor(boolean acceptNoChildren, ChildrenProcessor childrenProcessor,
                                  Class<?> childProcessorClass, boolean isAgregator,
                                  WidgetChildProcessor<?> processor, Device[] supportedDevices)
    {
      TagConstraints processorAttributes = this.factoryHelper.getChildtrenAttributesAnnotation(childProcessorClass);
      final String widgetProperty = (processorAttributes!=null?processorAttributes.widgetProperty():"");
      String tagName = (processorAttributes!=null?processorAttributes.tagName():"");

      final boolean isAnyWidget = (AnyWidgetChildProcessor.class.isAssignableFrom(childProcessorClass));
      final boolean isAnyWidgetType = (processorAttributes!=null && (AnyWidget.class.isAssignableFrom(processorAttributes.type()) ||
                                       WidgetCreator.class.isAssignableFrom(processorAttributes.type())));
     
      TagChildLazyConditions lazyConditions = childProcessorClass.getAnnotation(TagChildLazyConditions.class);
      final WidgetLazyChecker lazyChecker = (lazyConditions== null?null:LazyWidgets.initializeLazyChecker(lazyConditions));
     
      final String childName = getChildTagName(tagName, isAgregator, (isAnyWidget || isAnyWidgetType));
View Full Code Here

   * @return
   */
  private ChildrenProcessor createChildProcessorForText(Class<?> processorClass, TagChild child, final boolean acceptNoChildren)
    {
    Class<?> childProcessor = child.value();
    TagConstraints processorAttributes = factoryHelper.getChildtrenAttributesAnnotation(childProcessor);
    final String widgetProperty = processorAttributes.widgetProperty();
    final boolean isHasText = HasText.class.isAssignableFrom(factoryHelper.getWidgetType());
   
      ChildrenProcessor childrenProcessor = new ChildrenProcessor()
    {
      public void processChildren(SourcePrinter out, WidgetCreatorContext context)
View Full Code Here

   * @return
   */
  private ChildrenProcessor doCreateChildrenProcessorForSingleChild(Class<?> processorClass, final boolean acceptNoChildren,
                      WidgetChildProcessor<?> processor, Class<?> childProcessorClass, Device[] supportedDevices)
    {
    TagConstraints processorAttributes = this.factoryHelper.getChildtrenAttributesAnnotation(childProcessorClass);
    final String widgetProperty = (processorAttributes!=null?processorAttributes.widgetProperty():"");
    String tagName = (processorAttributes!=null?processorAttributes.tagName():"");

    final boolean isAgregator = isAgregatorProcessor(childProcessorClass);
    final boolean isAnyWidget = (AnyWidgetChildProcessor.class.isAssignableFrom(childProcessorClass));
      final boolean isAnyWidgetType = (processorAttributes!=null && (AnyWidget.class.isAssignableFrom(processorAttributes.type()) ||
           WidgetCreator.class.isAssignableFrom(processorAttributes.type())));

    TagChildLazyConditions lazyConditions = childProcessorClass.getAnnotation(TagChildLazyConditions.class);
    final WidgetLazyChecker lazyChecker = (lazyConditions== null?null:LazyWidgets.initializeLazyChecker(lazyConditions));
   
    final String childName = getChildTagName(tagName, isAgregator, (isAnyWidget || isAnyWidgetType));
View Full Code Here

  {
    AllowedOccurences allowed = new AllowedOccurences();
    try
    {
      Class<?> childProcessorType = child.value();
      TagConstraints processorAttributes = factoryHelper.getChildtrenAttributesAnnotation(childProcessorType);

      if (processorAttributes != null)
      {
        String minOccurs = processorAttributes.minOccurs();
        if (minOccurs.equals("unbounded"))
        {
          allowed.minOccurs = UNBOUNDED;
        }
        else
        {
          allowed.minOccurs = Integer.parseInt(minOccurs);
        }

        String maxOccurs = processorAttributes.maxOccurs();
        if (maxOccurs.equals("unbounded"))
        {
          allowed.maxOccurs = UNBOUNDED;
        }
        else
View Full Code Here

TOP

Related Classes of org.cruxframework.crux.core.rebind.screen.widget.declarative.TagConstraints

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.