com.vaadin.client.WidgetMap Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of vaadin-client Show documentation
Show all versions of vaadin-client Show documentation
Vaadin is a web application framework for Rich Internet Applications (RIA).
Vaadin enables easy development and maintenance of fast and
secure rich web
applications with a stunning look and feel and a wide browser support.
It features a server-side architecture with the majority of the logic
running
on the server. Ajax technology is used at the browser-side to ensure a
rich
and interactive user experience.
/*
* Copyright 2000-2014 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.vaadin.client;
import java.util.HashMap;
/**
* Abstract class mapping between {@link ComponentConnector} instances and their
* instances.
*
* A concrete implementation of this class is generated by WidgetMapGenerator or
* one of its subclasses during widgetset compilation.
*/
abstract class WidgetMap {
protected static HashMap, WidgetInstantiator> instmap = new HashMap, WidgetInstantiator>();
/**
* Create a new instance of a connector based on its type.
*
* @param classType
* {@link ComponentConnector} class to instantiate
* @return new instance of the connector
*/
public ServerConnector instantiate(
Class extends ServerConnector> classType) {
return instmap.get(classType).get();
}
/**
* Return the connector class to use for a fully qualified server side
* component class name.
*
* @param fullyqualifiedName
* fully qualified name of the server side component class
* @return component connector class to use
*/
public abstract Class extends ServerConnector> getConnectorClassForServerSideClassName(
String fullyqualifiedName);
/**
* Return the connector classes to load after the initial widgetset load and
* start.
*
* @return component connector class to load after the initial widgetset
* loading
*/
public abstract Class extends ServerConnector>[] getDeferredLoadedConnectors();
/**
* Make sure the code for a (deferred or lazy) component connector type has
* been loaded, triggering the load and waiting for its completion if
* necessary.
*
* @param classType
* component connector class
*/
public abstract void ensureInstantiator(
Class extends ServerConnector> classType);
}