Can be called only before {@link #create()} is invoked.

@param componentScanner used to scan for annotated classes.
@param scanningRoot root of the scanning.
327590
protected void registerComponents(final ClassScanner componentScanner, final Class<?> scanningRoot) {
        componentScanners.add(new Pair<Class<?>, ClassScanner>(scanningRoot, componentScanner));
    }
1217023
private boolean initialzeScanHelper() {
        mScanHelper = new ScanHelper(this);
        mScanState = ScanState.restore(ScanJob.this);
        mScanState.setLastScanStartTimeMillis(System.currentTimeMillis());
        mScanHelper.setMonitoringStatus(mScanState.getMonitoringStatus());
        mScanHelper.setRangedRegionState(mScanState.getRangedRegionState());
        mScanHelper.setBeaconParsers(mScanState.getBeaconParsers());
        mScanHelper.setExtraDataBeaconTracker(mScanState.getExtraBeaconDataTracker());
        if (mScanHelper.getCycledScanner() == null) {
            try {
                mScanHelper.createCycledLeScanner(mScanState.getBackgroundMode(), null);
            }
            catch (OutOfMemoryError e) {
                LogManager.w(TAG, "Failed to create CycledLeScanner thread.");
                return false;
            }
        }
        return true;
    }
1180044
public void scanConfigurableBeans(String... basePackages) throws BeanRuleException {
        if (basePackages == null || basePackages.length == 0) {
            return;
        }

        log.info("Auto component scanning on packages [" + StringUtils.joinCommaDelimitedList(basePackages) + "]");

        for (String basePackage : basePackages) {
            BeanClassScanner scanner = new BeanClassScanner(classLoader);
            List<BeanRule> beanRules = new ArrayList<>();
            scanner.scan(basePackage + ".**", (resourceName, targetClass) -> {
                if (targetClass.isAnnotationPresent(Component.class)) {
                    BeanRule beanRule = new BeanRule();
                    beanRule.setBeanClass(targetClass);
                    beanRule.setScopeType(ScopeType.SINGLETON);
                    beanRules.add(beanRule);
                }
            });
            for (BeanRule beanRule : beanRules) {
                saveConfigurableBeanRule(beanRule);
            }
        }
    }
728052
void root(ProtoType type) {
    if (type == null) throw new NullPointerException("type == null");
    checkArgument(!identifierSet.excludes(type));
    checkArgument(!members.containsKey(type));
    types.add(type);
  }
745976
@Override
    void setScanResult(final ScanResult scanResult) {
        super.setScanResult(scanResult);
        if (this.typeDescriptor != null) {
            this.typeDescriptor.setScanResult(scanResult);
        }
        if (this.typeSignature != null) {
            this.typeSignature.setScanResult(scanResult);
        }
        if (this.annotationInfo != null) {
            for (final AnnotationInfo ai : this.annotationInfo) {
                ai.setScanResult(scanResult);
            }
        }
        if (this.parameterAnnotationInfo != null) {
            for (final AnnotationInfo[] pai : this.parameterAnnotationInfo) {
                if (pai != null) {
                    for (final AnnotationInfo ai : pai) {
                        ai.setScanResult(scanResult);
                    }
                }
            }
        }
        if (this.parameterInfo != null) {
            for (final MethodParameterInfo mpi : parameterInfo) {
                mpi.setScanResult(scanResult);
            }
        }
    }
219518
public void setRootElement(java.lang.String rootElement) {
        getStateHelper().put(PropertyKeys.rootElement, rootElement);
        handleAttribute("rootElement", rootElement);
    }
724165
protected void init(com.sun.javadoc.RootDoc root,
                      String dest,
                      String templateClassName) throws Exception {

        mRootDoc = new RootDoc(root);

        mDest = new File(dest);
        mDest.mkdirs();

        mTemplateClassName = templateClassName;
        if (mTemplateClassName == null) {
            printWarning("No template name");
            return;
        }

        String[] templatePath = ClassDoc.parseClassName(mTemplateClassName);

        //
        // Load the specified template class
        //

        TemplateLoader loader =
            new TemplateLoader(getClass().getClassLoader(),
                               templatePath[0]);

        mTemplate = loader.getTemplate(templatePath[1]);

        Class[] params = mTemplate.getParameterTypes();
        if (params.length != 1 || params[0] != ClassDoc.class) {
            printError("Template has incorrect param signature");
        }
    }
1321774
public void setRootMethodAdapter(JavaRootMethodAdapter rootMethodAdapter) {
        if (rootMethodAdapter == null) {
            throw new NullPointerException();
        }
        if (acceptableTestFramework == null) {
            throw new IllegalStateException("acceptableTestFramework is not set");
        }
        if (acceptableTestFramework.equals(rootMethodAdapter.getName())) {
            this.rootMethodAdapter = rootMethodAdapter;
        }
    }
1258328
private void scanFields(Class<?> c)
    {
        if (!c.isInterface())
        {
            Field[] fields = c.getDeclaredFields();
            for (Field field : fields)
            {
                String fieldName = field.getName();

                if (pairs.containsKey(fieldName))
                {
                    if (field.isAnnotationPresent(UriTransient.class))
                    {
                        pairs.remove(fieldName);
                    }
                    else if (field.isAnnotationPresent(VarName.class))
                    {
                        String name = field.getAnnotation(VarName.class).value();
                        pairs.put(name, pairs.get(fieldName));
                        pairs.remove(fieldName);
                    }
                }
            }
        }
      /*
       * We still need to scan the fields of the super class if its
       * not Object to check for annotations. There might be a better
       * way to do this.
       */
        if (!c.getSuperclass().equals(Object.class))
        {
            scanFields(c.getSuperclass());
        }
    }
346252
protected InputContainerElements scan(final UIComponent component, InputContainerElements elements,
            final FacesContext context) {
        if (elements == null) {
            elements = new InputContainerElements();
        }

        // NOTE we need to walk the tree ignoring rendered attribute because it's condition
        // could be based on what we discover
        if ((elements.getLabel() == null) && (component instanceof HtmlOutputLabel)) {
            elements.setLabel((HtmlOutputLabel) component);
        } else if (component instanceof EditableValueHolder) {
            elements.registerInput((EditableValueHolder) component, getDefaultValidator(context), context);
        } else if (component instanceof UIMessage) {
            elements.registerMessage((UIMessage) component);
        }
        // may need to walk smarter to ensure "element of least suprise"
        for (UIComponent child : component.getChildren()) {
            scan(child, elements, context);
        }

        return elements;
    }
895627
public static void scan(final Class<? extends Annotation> clas, final String[] basePackage, final AnnotationHandler handler) {
		final ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(false);
		scanner.setResourceLoader(new PathMatchingResourcePatternResolver(Thread.currentThread().getContextClassLoader()));
		scanner.addIncludeFilter(new AnnotationTypeFilter(clas));
		for (final String pck : basePackage) {
			for (final BeanDefinition bd : scanner.findCandidateComponents(pck)) {
				handler.handleAnnotationFound(bd.getBeanClassName());
			}
		}
	}
1236578
public void setRootNode(TreeElement rootNode)
    {
        _rootNode = rootNode;
        if (rootNode.getName() == null) {
            rootNode.setName("0");
        }
    }
498388
private void scanAllNodes(Parent parent, PseudoClass pseudoClass) {
        parent.getChildrenUnmodifiable().addListener(new ListChangeListener<Node>() {
            @Override
            public void onChanged(javafx.collections.ListChangeListener.Change<? extends Node> c) {
                while (c.next()) {
                    if (!c.wasPermutated() && !c.wasUpdated()) {
                        for (Node addedNode : c.getAddedSubList()) {
                            if (addedNode instanceof Parent) {
                                scanAllNodes((Parent) addedNode, pseudoClass);
                            }
                        }
                    }
                }
            }
        });
        for (Node component : parent.getChildrenUnmodifiable()) {
            if (component instanceof Pane) {
                ((Pane) component).getChildren().addListener(new ListChangeListener<Node>() {
                    @Override
                    public void onChanged(javafx.collections.ListChangeListener.Change<? extends Node> c) {
                        while (c.next()) {
                            if (!c.wasPermutated() && !c.wasUpdated()) {
                                for (Node addedNode : c.getAddedSubList()) {
                                    if (addedNode instanceof Parent) {
                                        scanAllNodes((Parent) addedNode, pseudoClass);
                                    }
                                }
                            }
                        }
                    }
                });
                //if the component is a container, scan its children
                scanAllNodes((Pane) component, pseudoClass);
            } else if (component instanceof ScrollPane) {
                ((ScrollPane) component).contentProperty().addListener((o, oldVal, newVal) -> {
                    scanAllNodes((Parent) newVal, pseudoClass);
                });
                //if the component is a container, scan its children
                if (((ScrollPane) component).getContent() instanceof Parent) {

                    scanAllNodes((Parent) ((ScrollPane) component).getContent(), pseudoClass);
                }
            } else if (component instanceof Control) {
                //if the component is an instance of IInputControl, add to list
                component.pseudoClassStateChanged(PSEUDO_CLASS_EX_SMALL,
                    pseudoClass == PSEUDO_CLASS_EX_SMALL);
                component.pseudoClassStateChanged(PSEUDO_CLASS_SMALL, pseudoClass == PSEUDO_CLASS_SMALL);
                component.pseudoClassStateChanged(PSEUDO_CLASS_MEDIUM, pseudoClass == PSEUDO_CLASS_MEDIUM);
                component.pseudoClassStateChanged(PSEUDO_CLASS_LARGE, pseudoClass == PSEUDO_CLASS_LARGE);
            }
        }
    }
852193
public void setRoot(int root)
  {

    super.setRoot(root);

  	m_exprObj = FilterExprIteratorSimple.executeFilterExpr(root, 
  	                  m_lpi.getXPathContext(), m_lpi.getPrefixResolver(), 
  	                  m_lpi.getIsTopLevel(), m_lpi.m_stackFrame, m_expr);

  }
134167
synchronized void activate(ComponentContext componentContext) throws Exception {
        this.componentContext = componentContext;
        this.classAvailableTransformer = new ClassAvailableTransformer(this, instrumentation, includeBootstrap);
        this.transformer = new ProbeClassFileTransformer(this, instrumentation, includeBootstrap);
        this.proxyActivator = new MonitoringProxyActivator(componentContext.getBundleContext(), this, this.instrumentation);
        this.proxyActivator.activate();
        // The class available transformer is registered as retransform incapable
        // to avoid having to keep track of which classes have been updated with
        // static initializers and serialVersionUID fields.  The probe transformer
        // however, must run through the listener config every time a retransform
        // occurs to allow it to discover new probes and replace currently active
        // probes

        //RTCD 89497-Update the set with the classes
        for (Class<?> clazz : MonitoringUtility.loadMonitoringClasses(componentContext.getBundleContext().getBundle())) {
            for (int i = 0; i < clazz.getMethods().length; i++) {
                Annotation anno = ((clazz.getMethods()[i]).getAnnotation(ProbeSite.class));
                if (anno != null) {
                    String temp = ((ProbeSite) anno).clazz();
                    probeMonitorSet.add(temp);
                }
            }
        }
        //Update to the set ended.

        //RTC D89497 adding instrumentors moved below as the MonitoringUtility.loadMonitoringClasses
        //was resulting in loading classes and in turn getting called during with transform process which
        //might cause hang in some situations
        this.instrumentation.addTransformer(this.transformer, true);
        this.instrumentation.addTransformer(this.classAvailableTransformer);
        // We're active so if we have any listeners, we can run down the loaded
        // classes.
        for (Class<?> clazz : this.instrumentation.getAllLoadedClasses()) {
            classAvailable(clazz);
        }
    }
898661
public org.teatrove.tea.compiler.Scanner createScanner(SourceReader sr, CompilationUnit unit)
    throws IOException {
        org.teatrove.tea.compiler.Scanner scanner = super.createScanner(sr, unit);
        CompileListener scannerListener = getScannerListener();
        if (scannerListener != null) {
            scanner.addCompileListener(scannerListener);
        }
        return scanner;
    }
1021020
private void initComponents(URL baseurl) 
    {
        documentScroll = new javax.swing.JScrollPane();
        
        //Create the browser canvas
        browserCanvas = new BrowserCanvas(docroot, decoder, new java.awt.Dimension(1000, 600), baseurl);

        //A simple mouse listener that displays the coordinates clicked
        browserCanvas.addMouseListener(new MouseListener() {
            public void mouseClicked(MouseEvent e)
            {
                System.out.println("Click: " + e.getX() + ":" + e.getY());
            }
            public void mousePressed(MouseEvent e) { }
            public void mouseReleased(MouseEvent e) { }
            public void mouseEntered(MouseEvent e) { }
            public void mouseExited(MouseEvent e) { }
        });
        
        getContentPane().setLayout(new java.awt.GridLayout(1, 0));

        setTitle("CSSBox Browser");
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                exitForm(evt);
            }
        });

        documentScroll.setViewportView(browserCanvas);
        getContentPane().add(documentScroll);
        pack();
    }