Create all the links possible between the DeclarationBinder and all the ImportDeclaration matching the.
ImportDeclarationFilter of the Linker.

@param declarationBinderRef the ServiceReference<DeclarationBinder> of the DeclarationBinder
328054
public void createLinks(ServiceReference<S> declarationBinderRef) {
        for (D declaration : linkerManagement.getMatchedDeclaration()) {
            if (linkerManagement.canBeLinked(declaration, declarationBinderRef)) {
                linkerManagement.link(declaration, declarationBinderRef);
            }
        }
    }
1027775
@Check
	public void checkImportsMapping(XImportDeclaration importDeclaration) {
		final JvmDeclaredType type = importDeclaration.getImportedType();
		doTypeMappingCheck(importDeclaration, type, this.typeErrorHandler1);
	}
157678
public ClassRef toInternalReference() {
        List<TypeRef> arguments = new ArrayList<TypeRef>();
        for (TypeParamDef parameter : parameters) {
            arguments.add(parameter.toReference());
        }
        return new ClassRefBuilder()
                .withDefinition(this)
                .withArguments(arguments)
                .withAttributes(getAttributes())
                .build();
    }
457171
@Override
    protected void addHref(VertexWrapper vWrapper, Map<String, Object> filteredPropertyMap) {
        Map<String, Object> map = new HashMap<>(filteredPropertyMap);
        if (guid.equals("*")) {
            map.put(EntityTagResourceDefinition.ENTITY_GUID_PROPERTY, vWrapper.getVertex().getEdges(Direction.IN).
                    iterator().next().getVertex(Direction.OUT).getProperty(Constants.GUID_PROPERTY_KEY));
        } else {
            map.put(EntityTagResourceDefinition.ENTITY_GUID_PROPERTY, guid);
        }

        String href = resourceDefinition.resolveHref(map);
        if (href != null) {
            filteredPropertyMap.put("href", href);
        }
    }
429591
public static LinkedBindingBuilder<HttpClientObserver> bindNewObserver(final Binder binder, final Annotation annotation)
    {
        return Multibinder.newSetBinder(binder, HttpClientObserver.class, annotation).addBinding();
    }
882260
@Override
    public InjectionBinding<WebServiceRef> createOverrideInjectionBinding(Class<?> instanceClass, Member member,
                                                                          Resource resource, String jndiName) throws InjectionException {

        Class<?> typeClass = resource.type();

        if (member != null) {
            Class<?> inferredType = InjectionHelper.getTypeFromMember(member);
            if (typeClass.getName().equals(Object.class.getName())) { //default
                typeClass = inferredType;
//            } else {
//                if (!inferredType.isAssignableFrom(typeClass)) {
//                    Tr.error(tc, "error.service.ref.member.level.annotation.type.not.compatible",
//                             member.getName(), member.getDeclaringClass().getName(), typeClass.getName(), inferredType.getName());
//                    throw new InjectionException(Tr.formatMessage(tc, "error.service.ref.member.level.annotation.type.not.compatible",
//                                                                  member.getName(), member.getDeclaringClass().getName(), typeClass.getName(), inferredType.getName()));
//                }
            }
        }

        InjectionBinding<WebServiceRef> binding;

        //only service type injections are possible with the @Resource annotation
        if (Service.class.isAssignableFrom(typeClass)) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "The @Resource annotation found has type=" + typeClass.getName() + " and is refers to a JAX-WS service reference");
            }
            binding = WebServiceRefBindingBuilder.createWebServiceRefBindingFromResource(resource, ivNameSpaceConfig, typeClass, jndiName);
        } else {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "The @Resource annotation found did not refer to a web service reference type.");
            }
            binding = null;
        }

        return binding;
    }
237170
@SuppressWarnings("unchecked")
	private static BindingConfigurationEntry parseBindingConfigurationEntryElement(Element element) {

    	Class<?> bindingClass = null;
    	Class<?> sourceClass = null;
    	Class<?> targetClass = null;
        Method toMethod = null;
        Method fromMethod = null;
        Constructor<?> fromConstructor = null;
        Class<? extends Annotation> qualifier = DefaultBinding.class;
        
        if (element.getAttribute("class").length() > 0) {
        	bindingClass = lookupClass(element.getAttribute("class"));
        }
        
        if (element.getAttribute("sourceClass").length() > 0) {
            sourceClass = lookupClass(element.getAttribute("sourceClass"));
        }
        if (element.getAttribute("targetClass").length() > 0) {
        	targetClass = lookupClass(element.getAttribute("targetClass"));
        }

        if (element.getAttribute("qualifier").length() > 0) {
        	
            qualifier = (Class<? extends Annotation>) lookupClass(element.getAttribute("qualifier"));

            if (qualifier.getAnnotation(BindingScope.class) == null) {
                    throw new IllegalStateException("Qualifier class {" + element.getAttribute("qualifier")
                            + "} was not marked as BindingScope");
            }
        }

        if (bindingClass != null) {
	        for (Node next : new IterableNodeList(element.getChildNodes())) {
	            if (Node.ELEMENT_NODE == next.getNodeType()) {
	                Element childElement = (Element) next;
	                if (BINDINGS_NAMESPACE.equals(element.getNamespaceURI())
	                        && "toMethod".equals(element.getLocalName())) {
	
	                    String toMethodName = childElement.getTextContent();
	
	                    try {
	                        toMethod = bindingClass.getMethod(toMethodName, new Class[] { targetClass });
	                    } catch (SecurityException e) {
	                    } catch (NoSuchMethodException e) {
	                    }
	                    if (toMethod != null && (!String.class.equals(toMethod.getReturnType())
	                            || !Modifier.isStatic(toMethod.getModifiers()))) {
	                        toMethod = null;
	                    }
	                    if (toMethod == null && bindingClass.equals(targetClass)) {
	                        try {
	                            toMethod = bindingClass.getMethod(toMethodName, new Class[] {});
	                        } catch (SecurityException e) {
	                        } catch (NoSuchMethodException e) {
	                        }
	                        if (toMethod != null && Modifier.isStatic(toMethod.getModifiers())) {
	                            toMethod = null;
	                        }
	                    }
	
	                } else if (BINDINGS_NAMESPACE.equals(element.getNamespaceURI())
	                        && "fromMethod".equals(element.getLocalName())) {
	
	                    String fromMethodName = childElement.getTextContent();
	
	                    try {
	                        fromMethod = bindingClass.getMethod(fromMethodName, new Class[] { String.class });
	                    } catch (SecurityException e) {
	                    } catch (NoSuchMethodException e) {
	                    }
	                    if (fromMethod != null && ((targetClass != null && !targetClass.isAssignableFrom(fromMethod.getReturnType()))
	                    	|| !Modifier.isStatic(fromMethod.getModifiers()))) {
	                    	fromMethod = null;
	                    }
	
	                } else if (BINDINGS_NAMESPACE.equals(element.getNamespaceURI())
	                        && "fromConstructor".equals(element.getLocalName())) {
	
	                    try {
	                        fromConstructor = bindingClass.getConstructor(new Class[] { String.class });
	                    } catch (SecurityException e) {
	                    } catch (NoSuchMethodException e) {
	                    }
	                }
	            }
	        }
        }

        if (bindingClass == null) {

        	if (sourceClass == null) {
        		throw new IllegalStateException("If bindingClass is not populated, sourceClass must be present");
        	}
        	if (targetClass == null) {
        		throw new IllegalStateException("If bindingClass is not populated, targetClass must be present");
        	}
        	if (fromMethod != null && fromConstructor != null) {
        		throw new IllegalStateException("If fromMethod is populated, fromConstructor must not be present");
        	}

        	if (fromMethod == null) {
        	
        		return new BindingConfigurationEntry(sourceClass, targetClass, qualifier, toMethod, fromConstructor);
        	} else {
        		
        		return new BindingConfigurationEntry(sourceClass, targetClass, qualifier, toMethod, fromMethod);
        	}
        } else {
        	if (sourceClass != null) {
        		throw new IllegalStateException("If bindingClass is populated, sourceClass must not be present");
        	}
        	if (targetClass != null) {
        		throw new IllegalStateException("If bindingClass is populated, targetClass must not be present");
        	}
        	if (toMethod != null) {
        		throw new IllegalStateException("If bindingClass is populated, toMethod must not be present");
        	}
        	if (fromMethod != null) {
        		throw new IllegalStateException("If bindingClass is populated, fromMethod must not be present");
        	}
        	if (fromConstructor != null) {
        		throw new IllegalStateException("If bindingClass is populated, fromConstructor must not be present");
        	}
        	
        	return new BindingConfigurationEntry(bindingClass, qualifier);
        }
    }
996521
public synchronized void createImportationDeclaration(String deviceId, String deviceType, String deviceSubType) {
        Map<String, Object> metadata = new HashMap<String, Object>();
        metadata.put(Constants.DEVICE_ID, deviceId);
        metadata.put(Constants.DEVICE_TYPE, deviceType);
        metadata.put(Constants.DEVICE_TYPE_SUB, deviceSubType);
        metadata.put("scope", "generic");
        ImportDeclaration declaration = ImportDeclarationBuilder.fromMetadata(metadata).build();

        importDeclarations.put(deviceId, declaration);

        registerImportDeclaration(declaration);
    }
847878
protected final void declareReturnType(IndentingWriter o, List<IType> intermediates, boolean usesDefaltValues) throws BindingException {
    generateAccessModifier(o);

    if (returnType == null && intermediates == null) {
      o.print("void ");
    } else {
      // we assume that the [retval] param to be passed by reference
      TypeBinding retBinding = TypeBinding.bind(g, returnType, null);

      // add @ReturnValue if necessary
      if ((!retBinding.isDefault && needsMarshalAs()) || (retParam != -1 && (params[retParam].isIn() || retParam != params.length - 1))
          || intermediates != null
          || usesDefaltValues) {
        o.print("@ReturnValue(");
        o.beginCommaMode();
        if (!retBinding.isDefault && needsMarshalAs()) {
          o.comma();
          o.print("type=NativeType." + retBinding.nativeType.name());
        }
        if (retParam != -1 && params[retParam].isIn()) {
          o.comma();
          o.print("inout=true");
        }
        if (retParam != -1 && retParam != params.length - 1 || usesDefaltValues) {
          o.comma();
          o.print("index=" + retParam);
        }

        if (intermediates != null) {
          o.comma();
          o.print("defaultPropertyThrough={");
          o.beginCommaMode();
          for (IType im : intermediates) {
            TypeBinding vb = TypeBinding.bind(g, im, null);
            o.comma();
            o.print(vb.javaType);
            o.print(".class");
          }
          o.endCommaMode();
          o.print("}");
        }

        o.endCommaMode();
        o.println(")");
      }

      o.print(retBinding.javaType);
      o.print(' ');
    }
  }
612211
public void addBindingsType(TDefinitions definitions)
    {
        String interfacens;
        String interfacename;
        QName qname;
        String value;
        String name;
        
        if (soapFactory == null)
            soapFactory = new org.xmlsoap.schemas.wsdl.soap.ObjectFactory();
        
        // Create the bindings type
        TBinding binding = wsdlFactory.createTBinding();
        definitions.getAnyTopLevelOptionalElement().add(binding);
        name = this.getControlProperty(MessageControl.BINDING_NAME);
        binding.setName(name);
        interfacens = this.getNamespace();
        interfacename = this.getControlProperty(MessageControl.INTERFACE_NAME);
        qname = new QName(interfacens, interfacename);
        binding.setType(qname);
        //?LocalElement localElement = schemaFactory.createLocalElement();
        //?TBinding.getAny().add(localElement);
        org.xmlsoap.schemas.wsdl.soap.TBinding tBinding = soapFactory.createTBinding();
        binding.getAny().add(soapFactory.createBinding(tBinding));
        interfacens = this.getControlProperty(SOAP_URI);
        tBinding.setTransport(interfacens);
        tBinding.setStyle(org.xmlsoap.schemas.wsdl.soap.TStyleChoice.DOCUMENT);
        
        this.addBindingOperationTypes(binding);
    }
675553
public static final DeclarationTransformer getDeclarationTransformer() {
        if (dt == null) {
            try {
                @SuppressWarnings("unchecked")
                Class<? extends DeclarationTransformerImpl> clazz = (Class<? extends DeclarationTransformerImpl>) Class
                        .forName(DEFAULT_DECLARATION_TRANSFORMER);
                Method m = clazz.getMethod("getInstance");
                registerDeclarationTransformer((DeclarationTransformerImpl) m.invoke(null));
                log.debug("Retrived {} as default DeclarationTransformer implementation.",
                        DEFAULT_DECLARATION_TRANSFORMER);
            } catch (Exception e) {
                log.error("Unable to get DeclarationTransformer from default", e);
                throw new RuntimeException(
                        "No DeclarationTransformer implementation registered!");
            }
        }

        return dt;
    }
962427
private void _reportUndefinedNotationRefs()
        throws XMLStreamException
    {
        int count = mNotationForwardRefs.size();

        String id = mNotationForwardRefs.keySet().iterator().next();
        String msg = ""+count+" referenced notation"+((count == 1) ? "":"s")+" undefined: first one '"+id+"'";
        _reportVCViolation(msg);
    }
1103097
public void modified(ServiceReference<S> declarationBinderRef) throws InvalidFilterException {
        declarationBinders.get(declarationBinderRef).update(declarationBinderRef);
    }
106016
@Override
    public void resolve(InjectionBinding<Context> binding)
                    throws InjectionException {
        final String methodName = "resolve";
        if (tc.isEntryEnabled()) {
            Tr.entry(tc, methodName, binding);
        }
        Class<?> injectionType = binding.getInjectionClassType();

        if (tc.isDebugEnabled()) {
            Tr.debug(tc,
                     "Setting the ContextObjectFactory on the ContextInjectionBinding for type {0}",
                     injectionType);
        }
        Reference ref = new Reference(injectionType.getName());
        binding.setReferenceObject(ref, ContextObjectFactory.class);

        if (tc.isEntryEnabled())
            Tr.exit(tc, methodName, binding);
    }
369387
@SuppressWarnings("rawtypes")
    private static PluginDefinition parsePluginDefinition(final ClassLoader cl, final Element plugin) throws PluginConfigurationException {

        // Check if the plugin definition is inside its own file
        if (getAttributeValue(plugin, "definedIn", false) != null) {
            StreamManager sm = new StreamManager();

            String sFileName = getAttributeValue(plugin, "definedIn", false);

            try {
                InputStream in = sm.handle(cl.getResourceAsStream(sFileName));

                return parseXmlPluginDefinition(cl, in);
            } finally {
                sm.closeAll();
            }
        }

        String pluginClass = getAttributeValue(plugin, "class", true);

        Class clazz;
        try {
            clazz = LoadedClassCache.getClass(cl, pluginClass);

            if (!IPluginInterface.class.isAssignableFrom(clazz)) {
                throw new PluginConfigurationException("Specified class '" + clazz.getName() + "' in the plugin.xml file does not implement "
                        + "the IPluginInterface interface");
            }

            if (isAnnotated(clazz)) {
                return loadFromPluginAnnotation(clazz);
            }

        } catch (ClassNotFoundException e) {
            throw new PluginConfigurationException(e.getMessage(), e);
        }

        // The class is not annotated not has an external definition file...
        // Loading from current xml file...

        String sDescription = getAttributeValue(plugin, "description", false);

        @SuppressWarnings("unchecked")
        PluginDefinition pluginDef = new PluginDefinition(getAttributeValue(plugin, "name", true), sDescription, clazz);

        parseCommandLine(pluginDef, plugin);
        return pluginDef;
    }
1325049
private void initTypeParameterBindings()
    {
        //
        // Get an iterator to both the declared type arguments and the original type
        // declaration on the associated control interface
        //
        DeclaredType fieldType = (DeclaredType)_fieldDecl.getType();
        Iterator<TypeMirror> paramBoundIter = fieldType.getActualTypeArguments().iterator();

        TypeDeclaration intfDecl = (TypeDeclaration)_controlIntf.getTypeDeclaration();
        Iterator<TypeParameterDeclaration> paramDeclIter = 
                                            intfDecl.getFormalTypeParameters().iterator();

        //
        // Iterate through them in parallel, creating a mapping from the original formal
        // type parameter name to the actual bound type.  In parallel, also build up a
        // representation of the bound type declaration.
        //
        // NOTE: If no type binding is done on the field declaration, then loop below
        // will not execute and no mappings/empty bound decl will be the result.
        //
        StringBuffer sb = new StringBuffer();
        boolean isFirst = true;
        while (paramBoundIter.hasNext())
        {
            TypeMirror paramBound = paramBoundIter.next();
            TypeParameterDeclaration paramDecl = paramDeclIter.next();

            //
            // Save a mapping from the formal type name to the bound mirror type
            //
            _typeBindingMap.put(paramDecl.getSimpleName(), paramBound);

            if (isFirst)
            {
                sb.append("<");
                isFirst = false;
            }
            else
                sb.append(", ");
            sb.append(paramBound);
        }
        if (!isFirst)
            sb.append(">");
        
        _boundParameterDecl = sb.toString();
    }
980740
static InjectionBinding<WebServiceRef> createWebServiceRefBindingFromResource(Resource resource, ComponentNameSpaceConfiguration cnsConfig, Class<?> serviceClass,
                                                                                  String jndiName) throws InjectionException {
        InjectionBinding<WebServiceRef> binding = null;

        WebServiceRef wsRef = createWebServiceRefFromResource(resource, serviceClass, jndiName);
        WebServiceRefInfo wsrInfo = WebServiceRefInfoBuilder.buildWebServiceRefInfo(wsRef, cnsConfig.getClassLoader());
        wsrInfo.setClientMetaData(JaxWsMetaDataManager.getJaxWsClientMetaData(cnsConfig.getModuleMetaData()));
        wsrInfo.setServiceInterfaceClassName(serviceClass.getName());
        binding = new WebServiceRefBinding(wsRef, cnsConfig);

        // register the metadata, and set a flag on the binding instance that let's us
        // know this binding represents metadata from an @Resource annotation
        ((WebServiceRefBinding) binding).setWebServiceRefInfo(wsrInfo);
        ((WebServiceRefBinding) binding).setResourceType(true);

        return binding;
    }