Creates a component identified by given locator.

@param locator a locator to identify component to be created.
@return the created component.

@throws CreateException if the factory is not able to create the component.
494243
public Object create(Object locator) throws CreateException {
		if (locator == null)
			throw new NullPointerException("Locator cannot be null");

		// Iterate from the latest factories
		for (int index = _factories.size() - 1; index >= 0; index--) {
			IFactory factory = _factories.get(index);
			if (factory.canCreate(locator) != null)
				return factory.create(locator);
		}

		throw new CreateException(null, locator);
	}
617347
public void createControlAdapter()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.entry(tc, "createControlAdapter");
    controlAdapter = new ForeignBus(messageProcessor, this);
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) 
      SibTr.exit(tc, "createControlAdapter", controlAdapter);
  }
610818
public MessageBean setLocation(final Locator locator) {
        if (locator == null) {
            return this;
        }
        final MessageBean ret = new MessageBean(this);
        if (locator.getSystemId() != null) {
            try {
                ret.srcFile = new URI(locator.getSystemId());
            } catch (final URISyntaxException e) {
                throw new RuntimeException("Failed to parse URI '" + locator.getSystemId() + "': " + e.getMessage(), e);
            }
        }
        ret.srcLine = locator.getLineNumber();
        ret.srcColumn = locator.getColumnNumber();
        return ret;
    }
538450
@Override
    public QueueBrowser createBrowser(Queue queue, String messageSelector) throws JMSRuntimeException, InvalidDestinationRuntimeException, InvalidSelectorRuntimeException {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "createBrowser", new Object[] { queue, messageSelector });

        QueueBrowser queueBrowser = null;

        try {
            queueBrowser = jmsSession.createBrowser(queue, messageSelector);
        } catch (InvalidDestinationException ide) {
            throw (InvalidDestinationRuntimeException) JmsErrorUtils.getJMS2Exception(ide, InvalidDestinationRuntimeException.class);
        } catch (InvalidSelectorException ise) {
            throw (InvalidSelectorRuntimeException) JmsErrorUtils.getJMS2Exception(ise, InvalidSelectorRuntimeException.class);
        } catch (JMSException jmse) {
            throw (JMSRuntimeException) JmsErrorUtils.getJMS2Exception(jmse, JMSRuntimeException.class);
        } finally {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(this, tc, "createBrowser");
        }

        return queueBrowser;
    }
901936
public static ExpectedCondition<WebElement> elementToBeClickable(final By locator) {
    return new ExpectedCondition<WebElement>() {
      @Override
      public WebElement apply(WebDriver driver) {
        WebElement element = visibilityOfElementLocated(locator).apply(driver);
        try {
          if (element != null && element.isEnabled()) {
            return element;
          }
          return null;
        } catch (StaleElementReferenceException e) {
          return null;
        }
      }

      @Override
      public String toString() {
        return "element to be clickable: " + locator;
      }
    };
  }
13180
public Object createConnectionFactory(
            final ConnectionManager connectionManager) {

        if (TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, "createConnectionFactory",
                    connectionManager);
        }

        final Object connectionFactory = new SibRaConnectionFactory(this,
                connectionManager);

        if (TRACE.isEntryEnabled()) {
            SibTr.exit(this, TRACE, "createConnectionFactory",
                    connectionFactory);
        }
        return connectionFactory;

    }
1102424
private Object createResource(String refName, String className, String bindingName, ResourceInfo resourceRefInfo) throws Exception {
        String nameFilter = FilterUtils.createPropertyFilter(ResourceFactory.JNDI_NAME, bindingName);
        String createsFilter = className == null ? null : FilterUtils.createPropertyFilter(ResourceFactory.CREATES_OBJECT_CLASS, className);
        String filter = createsFilter == null ? nameFilter : "(&" + nameFilter + createsFilter + ")";
        ResourceInfo resInfo = resourceRefInfo != null ? resourceRefInfo : className != null ? new ResourceEnvRefInfo(refName, className) : null;
        return createResourceWithFilter(filter, resInfo);
    }
612925
private PropertySelector buildPropertySelector(GDLParser.PropertyLookupContext ctx) {
    GraphElement element;

    String identifier = ctx.Identifier(0).getText();
    String property = ctx.Identifier(1).getText();

    if(userVertexCache.containsKey(identifier)) {
      element = userVertexCache.get(identifier);
    }
    else if(userEdgeCache.containsKey(identifier)) {
      element = userEdgeCache.get(identifier);
    }
    else { throw new InvalidReferenceException(identifier);}

    return new PropertySelector(element.getVariable(),property);
  }
1252079
public FacesConfigComponentType<FacesConfigType<T>> getOrCreateComponent()
   {
      List<Node> nodeList = childNode.get("component");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new FacesConfigComponentTypeImpl<FacesConfigType<T>>(this, "component", childNode, nodeList.get(0));
      }
      return createComponent();
   }
876702
@Override
    public Object createResource(final ResourceInfo resInfo) throws Exception {
        final boolean trace = TraceComponent.isAnyTracingEnabled();
        if (trace && tc.isEntryEnabled())
            Tr.entry(this, tc, "createResource", resInfo);

        Object connectionFactory;

        lock.readLock().lock();
        try {
            if (!isInitialized.get()) {
                // Switch to write lock for lazy initialization
                lock.readLock().unlock();
                lock.writeLock().lock();
                try {
                    if (!isInitialized.get())
                        initPrivileged();
                } finally {
                    // Downgrade to read lock for rest of method
                    lock.readLock().lock();
                    lock.writeLock().unlock();
                }
            }
            checkAccess();
            ConnectionManager conMgr = AccessController.doPrivileged(new PrivilegedExceptionAction<ConnectionManager>() {
                @Override
                public ConnectionManager run() throws Exception {
                    return conMgrSvc.getConnectionManager(resInfo, AbstractConnectionFactoryService.this);
                }
            });
            connectionFactory = getManagedConnectionFactory(null).createConnectionFactory(conMgr);
        } catch (Exception x) {
            if (trace && tc.isEntryEnabled())
                Tr.exit(this, tc, "createResource", x);
            throw x;
        } catch (Error x) {
            if (trace && tc.isEntryEnabled())
                Tr.exit(this, tc, "createResource", x);
            throw x;
        } finally {
            lock.readLock().unlock();
        }

        // Only connection factories defined in the server configuration are tracked for the app recycle coordinator.
        if (isServerDefined) {
            ComponentMetaData cData = ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor().getComponentMetaData();
            if (cData != null)
                appsToRecycle.add(cData.getJ2EEName().getApplication());
        }

        if (trace && tc.isEntryEnabled())
            Tr.exit(this, tc, "createResource", connectionFactory);
        return connectionFactory;
    }
1095586
public static ScreenComponent createScreenComponent(String componentType, ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Map<String,Object> properties)
    {
        String screenFieldClass = null;
        if (!componentType.contains("."))
            screenFieldClass = ScreenModel.BASE_PACKAGE + componentType;
        else if (componentType.startsWith("."))
            screenFieldClass = DBConstants.ROOT_PACKAGE + componentType.substring(1);
        else
            screenFieldClass = componentType;
        ScreenComponent screenField = (ScreenComponent)ClassServiceUtility.getClassService().makeObjectFromClassName(screenFieldClass);
        if (screenField == null)
        {
            Utility.getLogger().warning("Screen component not found " + componentType);
            screenField = (ScreenComponent)ClassServiceUtility.getClassService().makeObjectFromClassName(ScreenModel.BASE_PACKAGE + ScreenModel.EDIT_TEXT);
        }
        screenField.init(itsLocation, targetScreen, converter, iDisplayFieldDesc, properties);
        return screenField;
    }
535112
@SuppressWarnings({"WeakerAccess", "unused"}) // For library users
    public static Searcher create(@NonNull final Searchable searchable) {
        final String key = searchable.toString();
        Searcher instance = instances.get(key);
        if (instance == null) {
            instance = new Searcher(searchable, key);
            instances.put(key, instance);
        } else {
            throw new IllegalStateException("There is already a Searcher for index " + key + ", you must specify a variant.");
        }
        return instance;
    }
293552
public ServiceBuilder withCacheFactory(Function<ComponentSetup, CacheFactory> cacheFactoryCreator) {
        Preconditions.checkNotNull(cacheFactoryCreator, "cacheFactoryCreator");
        this.cacheFactoryCreator = cacheFactoryCreator;
        return this;
    }
5291
protected SlingBean createComponent() throws ClassNotFoundException, IllegalAccessException,
            InstantiationException {
        SlingBean component = null;
        Class<? extends SlingBean> type = getComponentType();
        if (type != null) {
            BeanFactory factoryRule = type.getAnnotation(BeanFactory.class);
            if (factoryRule != null) {
                SlingBeanFactory factory = context.getService(factoryRule.serviceClass());
                if (factory != null) {
                    return factory.createBean(context, getModelResource(context), type);
                }
            }
            BeanContext baseContext = context.withResource(getModelResource(context));
            component = baseContext.adaptTo(type);
            injectServices(component);
            additionalInitialization(component);
        }
        return component;
    }
1067143
def create(self, locator):
        
        for registration in self._registrations:
            this_locator = registration.locator

            if this_locator == locator:
                try:
                    return registration.factory(locator)
                except Exception as ex:
                    if isinstance(ex, CreateException):
                        raise ex
                    
                    raise CreateException(
                        None,
                        "Failed to create object for " + str(locator)
                    ).with_cause(ex)
667357
@SuppressWarnings("unchecked")
    private static <T> T createCustomComponent(Class<T> componentType, Class<?> componentClass,
            Map<String, String> configProperties) throws Exception {
        if (componentClass == null) {
            throw new IllegalArgumentException("Invalid component spec (class not found)."); //$NON-NLS-1$
        }
        try {
            Constructor<?> constructor = componentClass.getConstructor(Map.class);
            return (T) constructor.newInstance(configProperties);
        } catch (Exception e) {
        }
        return (T) componentClass.getConstructor().newInstance();
    }
293907
protected Locator createLocator(final Token t) {
        return new Locator(getInputSource().getURI(),
            t == null ? 0 : t.beginLine,
            t == null ? 0 : t.beginColumn);
    }