Process the ComponentExposedType class to register all the fields and methods visible in the
context. TODO: Improve this method by putting things together with {@link
ComponentExposedTypeGenerator}

@param componentTypeElement The class to process
171168
private void registerFieldsAndMethodsInContext(TemplateParserContext templateParserContext,
      TypeElement componentTypeElement, Set<String> alreadyDoneVariable,
      Set<String> alreadyDoneMethods) {
    ElementFilter
        .fieldsIn(componentTypeElement.getEnclosedElements())
        .stream()
        .filter(field -> field.getAnnotation(Data.class) != null
            || field.getAnnotation(Prop.class) != null)
        .forEach(field -> {
          String name = field.getSimpleName().toString();
          if (alreadyDoneVariable.contains(name)) {
            return;
          }

          alreadyDoneVariable.add(name);
          templateParserContext.addRootVariable(ClassName.get(field.asType()), name);
        });

    ElementFilter
        .methodsIn(componentTypeElement.getEnclosedElements())
        .stream()
        .filter(method -> hasAnnotation(method, Computed.class))
        .filter(method -> !"void".equals(method.getReturnType().toString()))
        .forEach(method -> {
          String name = getComputedPropertyName(method);
          if (alreadyDoneVariable.contains(name)) {
            return;
          }
          alreadyDoneVariable.add(name);

          TypeMirror propertyType;
          if ("void".equals(method.getReturnType().toString())) {
            propertyType = method.getParameters().get(0).asType();
          } else {
            propertyType = method.getReturnType();
          }

          templateParserContext
              .addRootComputedProperty(ClassName.get(propertyType), name,
                  computedPropertyNameToFieldName(name));
        });

    ElementFilter
        .methodsIn(componentTypeElement.getEnclosedElements())
        .stream()
        .filter(ComponentGeneratorsUtil::isMethodVisibleInTemplate)
        .map(ExecutableElement::getSimpleName)
        .map(Object::toString)
        .forEach(methodName -> {
          if (alreadyDoneMethods.contains(methodName)) {
            return;
          }
          alreadyDoneMethods.add(methodName);

          templateParserContext.addRootMethod(methodName);
        });

    getSuperComponentType(componentTypeElement)
        .ifPresent(superComponent -> registerFieldsAndMethodsInContext(
            templateParserContext,
            superComponent,
            alreadyDoneVariable,
            alreadyDoneMethods));
  }
1279775
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WTemplate template = (WTemplate) component;

		// Setup the context
		Map<String, Object> context = new HashMap<>();
		// Make the component available under the "wc" key.
		context.put("wc", template);
		// Load the parameters
		context.putAll(template.getParameters());

		// Get template renderer for the engine
		String engine = template.getEngineName();
		if (Util.empty(engine)) {
			engine = ConfigurationProperties.getDefaultRenderingEngine();
		}
		TemplateRenderer templateRenderer = TemplateRendererFactory.newInstance(engine);

		// Render
		if (!Util.empty(template.getTemplateName())) {
			// Render the template
			templateRenderer.renderTemplate(template.getTemplateName(), context, template.getTaggedComponents(), renderContext.getWriter(),
					template.getEngineOptions());
		} else if (!Util.empty(template.getInlineTemplate())) {
			// Render inline
			templateRenderer.renderInline(template.getInlineTemplate(), context, template.getTaggedComponents(), renderContext.getWriter(),
					template.getEngineOptions());
		}
	}
1243924
private void registerXmlSchemaRepository(Element element, ParserContext parserContext) {
        BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(XsdSchemaRepository.class);
        BeanDefinitionParserUtils.setPropertyReference(builder, element.getAttribute("schema-mapping-strategy"), "schemaMappingStrategy");
        addLocationsToBuilder(element, builder);
        parseSchemasElement(element, builder, parserContext);
        parserContext.getRegistry().registerBeanDefinition(element.getAttribute(ID), builder.getBeanDefinition());
    }
311255
public void registerAspectComponents() throws Exception {
		Debug.logVerbose("[JdonFramework] note: registe aspect components ", module);
		try {
			InterceptorsChain existedInterceptorsChain = (InterceptorsChain) containerWrapper.lookup(ComponentKeys.INTERCEPTOR_CHAIN);

			Iterator iter = aspectConfigComponents.iterator();
			Debug.logVerbose("[JdonFramework] 3 aspectConfigComponents size:" + aspectConfigComponents.size(), module);
			while (iter.hasNext()) {
				String name = (String) iter.next();
				AspectComponentsMetaDef componentMetaDef = (AspectComponentsMetaDef) aspectConfigComponents.getComponentMetaDef(name);
				// registe into container
				xmlcontainerRegistry.registerAspectComponentMetaDef(componentMetaDef);
				// got the interceptor instance;
				// add interceptor instance into InterceptorsChain object
				existedInterceptorsChain.addInterceptor(componentMetaDef.getPointcut(), name);
			}
		} catch (Exception ex) {
			Debug.logError("[JdonFramework] registerAspectComponents error:" + ex, module);
			throw new Exception(ex);
		}

	}
627624
void process() {
        fixImports();
        if (insertRegion != null) {
            data.ensureImport(BeanDefinition.class);
            if (properties.size() > 0) {
                data.ensureImport(PropertyDefinition.class);
            }
            removeOld();
            if (data.isRootClass() && data.isExtendsDirectBean()) {
                data.ensureImport(DirectBean.class);
            }
            generateMeta();
            generateSerializationVersionId();
            generatePropertyChangeSupportField();
            generateHashCodeField();
            generateFactory();
            generateImmutableBuilderMethod();
            generateArgBasedConstructor();
            generateBuilderBasedConstructor();
            generateMetaBean();
            generateGettersSetters();
            generateSeparator();
            generateImmutableToBuilder();
            generateClone();
            generateEquals();
            generateHashCode();
            generateToString();
            generateMetaClass();
            generateBuilderClass();
            resolveImports();
            resolveIndents();
        }
    }
1310837
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WPanel panel = (WPanel) component;
		XmlStringBuilder xml = renderContext.getWriter();
		FlowLayout layout = (FlowLayout) panel.getLayout();
		Size gap = layout.getSpace();
		String gapString = gap != null ? gap.toString() : null;
		FlowLayout.Alignment align = layout.getAlignment();

		xml.appendTagOpen("ui:flowlayout");

		switch (align) {
			case RIGHT: {
				xml.appendAttribute("align", "right");
				break;
			}
			case CENTER: {
				xml.appendAttribute("align", "center");
				break;
			}
			case LEFT: {
				xml.appendAttribute("align", "left");
				break;
			}

			case VERTICAL:
				xml.appendAttribute("align", "vertical");
				break;

			default:
				throw new IllegalStateException("Unknown layout type: " + layout.getAlignment());
		}

		if (layout.getContentAlignment() != null) {
			switch (layout.getContentAlignment()) {
				case TOP: {
					xml.appendAttribute("valign", "top");
					break;
				}
				case MIDDLE: {
					xml.appendAttribute("valign", "middle");
					break;
				}
				case BASELINE: {
					xml.appendAttribute("valign", "baseline");
					break;
				}

				case BOTTOM:
					xml.appendAttribute("valign", "bottom");
					break;

				default:
					throw new IllegalStateException("Unknown content alignment type: " + layout.
							getContentAlignment());
			}
		}
		xml.appendOptionalAttribute("gap", gapString);

		xml.appendClose();

		int size = panel.getChildCount();

		for (int i = 0; i < size; i++) {
			xml.appendTag("ui:cell");
			WComponent child = panel.getChildAt(i);
			child.paint(renderContext);
			xml.appendEndTag("ui:cell");
		}

		xml.appendEndTag("ui:flowlayout");
	}
160294
private Builder createComponentExposedTypeBuilder(ClassName exposedTypeClassName) {
    return TypeSpec
        .classBuilder(exposedTypeClassName)
        .addModifiers(Modifier.PUBLIC)
        .superclass(TypeName.get(component.asType()))
        .addAnnotation(AnnotationSpec
            .builder(Generated.class)
            .addMember("value", "$S", ComponentExposedTypeGenerator.class.getCanonicalName())
            .addMember("comments", "$S", "https://github.com/Axellience/vue-gwt")
            .build());
  }
932276
public ComponentAdapter registerComponentInstance(Object componentKey, Object componentInstance) throws PicoRegistrationException {
		if (componentInstance instanceof MutablePicoContainer) {
			MutablePicoContainer pc = (MutablePicoContainer) componentInstance;
			Object contrivedKey = new Object();
			String contrivedComp = "";
			pc.registerComponentInstance(contrivedKey, contrivedComp);
			try {
				if (this.getComponentInstance(contrivedKey) != null) {
					throw new PicoRegistrationException("Cannot register a container to itself. The container is already implicitly registered.");
				}
			} finally {
				pc.unregisterComponent(contrivedKey);
			}

		}
		ComponentAdapter componentAdapter = new InstanceComponentAdapter(componentKey, componentInstance);
		registerComponent(componentAdapter);
		return componentAdapter;
	}
1232069
public ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation, List parameters)
			throws PicoRegistrationException {
		Parameter[] parametersAsArray = (Parameter[]) parameters.toArray(new Parameter[parameters.size()]);
		return registerComponentImplementation(componentKey, componentImplementation, parametersAsArray);
	}
478624
protected Object processElement(Object obj, Class<?> expectedType) {
		if (obj == null || obj instanceof Proxy) {
			return obj;
		}
		if (obj instanceof Doc) {
			return wrap(obj);
		} else if (expectedType != null && expectedType.isArray()) {
			final Class<?> componentType = expectedType.getComponentType();
			if (Doc.class.isAssignableFrom(componentType)) {
				final int len = Array.getLength(obj);
				final List<Object> list = new ArrayList<>(len);
				final ApidocExcluder excluder = this.configuration.get().getApidocExcluder();
				for (int i = 0; i < len; ++i) {
					final Object entry = Array.get(obj, i);
					if (!(entry instanceof Doc)) {
						list.add(processElement(entry, componentType));
					} else if (excluder.isExcluded((Doc) entry)) {
						if (excluder.isTranslatableToTag((Doc) entry)) {
							//
						}
					} else {
						list.add(processElement(entry, componentType));
					}
				}
				final Object newArray = Array.newInstance(componentType, list.size());
				int i = 0;
				for (final Object element : list) {
					Array.set(newArray, i, element);
					++i;
				}
				return newArray;
			}
		}
		return obj;
	}
280452
private void processRenderFunction() {
    if (!hasInterface(processingEnv, component.asType(), HasRender.class)) {
      return;
    }

    componentExposedTypeBuilder.addMethod(MethodSpec
        .methodBuilder("vg$render")
        .addModifiers(Modifier.PUBLIC)
        .addAnnotation(JsMethod.class)
        .returns(VNode.class)
        .addParameter(CreateElementFunction.class, "createElementFunction")
        .addStatement("return super.render(new $T(createElementFunction))", VNodeBuilder.class)
        .build());

    addMethodToProto("vg$render");

    // Register the render method
    optionsBuilder.addStatement("options.addHookMethod($S, p.$L)", "render", "vg$render");
  }
1223158
@Override
    public void processXML() throws InjectionException {

        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "processXML : " + this);

        List<? extends ConnectionFactory> connectionFactoryDefinitions = ivNameSpaceConfig.getJNDIEnvironmentRefs(ConnectionFactory.class);

        if (connectionFactoryDefinitions != null)
        {
            for (ConnectionFactory connectionFactory : connectionFactoryDefinitions)
            {
                String jndiName = connectionFactory.getName();
                InjectionBinding<ConnectionFactoryDefinition> injectionBinding = ivAllAnnotationsCollection.get(jndiName);
                ConnectionFactoryDefinitionInjectionBinding binding;

                if (injectionBinding != null)
                {
                    binding = (ConnectionFactoryDefinitionInjectionBinding) injectionBinding;
                }
                else
                {
                    binding = new ConnectionFactoryDefinitionInjectionBinding(jndiName, ivNameSpaceConfig);
                    addInjectionBinding(binding);
                }

                binding.mergeXML(connectionFactory);
            }
        }

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "processXML : " + this);

    }
492704
@Override
    public void processComponent(String propertyName, JComponent component) {

        if (component instanceof JComboBox) {
            this.installSearchable((JComboBox) component);
        } else if (component instanceof JList) {
            this.installSearchable((JList) component);
        } else if (component instanceof JTable) {
            this.installSearchable((JTable) component);
        } else if (component instanceof JTextComponent) {
            this.installSearchable((JTextComponent) component);
        }
    }
919910
protected FieldMetadata processSimpleType( FieldDeclaration fieldDeclaration ) {
        SimpleType simpleType = (SimpleType)fieldDeclaration.getType();
        FieldMetadata simpleTypeFieldMetadata = FieldMetadata.simpleType(JavaMetadataUtil.getName(simpleType.getName()));
        // modifiers
        processModifiersOfFieldDeclaration(fieldDeclaration, simpleTypeFieldMetadata);
        processVariablesOfVariableDeclarationFragment(fieldDeclaration, simpleTypeFieldMetadata);
        simpleTypeFieldMetadata.setName(getFieldName(fieldDeclaration));

        return simpleTypeFieldMetadata;
    }
762130
private int processRemoterElements(TypeSpec.Builder classBuilder, Element element, int methodIndex, ElementVisitor elementVisitor, MethodSpec.Builder methodBuilder) {
        if (element instanceof TypeElement) {
            for (TypeMirror typeMirror : ((TypeElement) element).getInterfaces()) {
                if (typeMirror instanceof DeclaredType) {
                    Element superElement = ((DeclaredType) typeMirror).asElement();
                    methodIndex = processRemoterElements(classBuilder, superElement, methodIndex, elementVisitor, methodBuilder);
                }
            }
            for (Element member : element.getEnclosedElements()) {
                if (member.getKind() == ElementKind.METHOD) {
                    elementVisitor.visitElement(classBuilder, member, methodIndex, methodBuilder);
                    methodIndex++;
                }
            }
        }
        return methodIndex;
    }
1128910
public void extendComponent( Component component ) {

		if( this.extendedComponent != null )
			this.extendedComponent.extendingComponents.remove( this );

		component.extendingComponents.add( this );
		this.extendedComponent = component;
	}
350048
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WImageEditor editorComponent = (WImageEditor) component;
		XmlStringBuilder xml = renderContext.getWriter();

		xml.appendTagOpen("wc-imageedit");
		xml.appendAttribute("id", editorComponent.getId());
		xml.appendOptionalAttribute("class", editorComponent.getHtmlClass());
		xml.appendOptionalUrlAttribute("overlay", editorComponent.getOverlayUrl());
		xml.appendOptionalAttribute("camera", editorComponent.getUseCamera());
		xml.appendOptionalAttribute("face", editorComponent.getIsFace());
		xml.appendOptionalAttribute("inline", editorComponent.getRenderInline());

		// Check for size information on the image
		Dimension size = editorComponent.getSize();
		if (size != null) {
			if (size.getHeight() >= 0) {
				xml.appendAttribute("height", size.height);
			}

			if (size.getWidth() >= 0) {
				xml.appendAttribute("width", size.width);
			}
		}

		xml.appendEnd();
	}