Top Description Inners Fields Constructors Methods
javafx.fxml

public Class FXMLLoader

extends Object
Class Inheritance
Imports
com.sun.javafx.util.Logging, java.io.IOException, .InputStream, .InputStreamReader, java.lang.reflect.Array, .Constructor, .Field, .InvocationTargetException, .Method, .Modifier, .ParameterizedType, .Type, java.net.URL, .MalformedURLException, java.nio.charset.Charset, java.util.AbstractMap, .ArrayList, .Collections, .HashMap, .LinkedList, .List, .Map, .ResourceBundle, .Set, .EnumMap, .Locale, .StringTokenizer, java.util.regex.Pattern, javafx.beans.DefaultProperty, .InvalidationListener, javafx.beans.property.Property, javafx.beans.value.ChangeListener, .ObservableValue, javafx.collections.*, javafx.event.Event, .EventHandler, javafx.util.Builder, .BuilderFactory, .Callback, javax.script.Bindings, .Compilable, .CompiledScript, .ScriptContext, .ScriptEngine, .ScriptEngineManager, .ScriptException, .SimpleBindings, javax.xml.stream.XMLInputFactory, .XMLStreamConstants, .XMLStreamException, .XMLStreamReader, javax.xml.stream.util.StreamReaderDelegate, com.sun.javafx.beans.IDProperty, com.sun.javafx.fxml.BeanAdapter, .ParseTraceElement, .PropertyNotFoundException, .FXMLLoaderHelper, .MethodHelper, com.sun.javafx.fxml.expression.Expression, .ExpressionValue, .KeyPath, com.sun.javafx.reflect.ConstructorUtil, .MethodUtil, .ReflectUtil

Loads an object hierarchy from an XML document. For more information, see the Introduction to FXML document.
Since
JavaFX 2.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
private static class
private class
private class
private abstract class
private class
private class
private static class
private static class
private static class
private static class
private static class
private class
private class
private class
private class
private static class
private static enum
private class
private class
private abstract class

Field Summary

Modifier and TypeField and Description
private static final Boolean
public static final String
ARRAY_COMPONENT_DELIMITER

Delimiter for arrays as values.

public static final String
BI_DIRECTIONAL_BINDING_PREFIX

Prefix for bidirectional-binding expression resolution.

public static final String
BI_DIRECTIONAL_BINDING_SUFFIX

Suffix for bidirectional-binding expression resolution.

public static final String
BINDING_EXPRESSION_PREFIX

Prefix for binding expression resolution.

public static final String
BINDING_EXPRESSION_SUFFIX

Suffix for binding expression resolution.

private BuilderFactory
private Class<?>
public static final String
CHANGE_EVENT_HANDLER_SUFFIX

Suffix for property change/invalidation handlers.

private Charset
private Map<String, Class<?>>
private ClassLoader
private static final String
public static final String
COMPILE_PROCESSING_INSTRUCTION

The tag name of the compile processing instruction.

private static boolean
private Object
public static final String
CONTROLLER_KEYWORD

A key for controller in namespace map.

public static final String
CONTROLLER_METHOD_PREFIX

Prefix for controller method resolution.

public static final String
CONTROLLER_SUFFIX

A suffix for controllers of included fxml files.

private final FXMLLoader.ControllerAccessor
private Callback<Class<?>, Object>
public static final String
COPY_SOURCE_ATTRIBUTE

The <fx:copy> 'source' attribute.

public static final String
COPY_TAG

The tag name of <fx:copy>.

private FXMLLoader.Element
private static BuilderFactory
public static final String
DEFAULT_CHARSET_NAME

The character set used when character set is not explicitly specified.

private static ClassLoader
public static final String
DEFINE_TAG

The tag name of <fx:define>.

public static final String
ESCAPE_PREFIX

Escape prefix for escaping special characters inside attribute values.

public static final String
EVENT_HANDLER_PREFIX

The prefix of event handler attributes.

public static final String
EVENT_KEY

The name of the Event object in event handler scripts.

public static final String
EXPRESSION_PREFIX

Prefix for (variable) expression resolution.

private static final Pattern
public static final String
FX_CONSTANT_ATTRIBUTE

The tag name of 'fx:constant'.

public static final String
FX_CONTROLLER_ATTRIBUTE

The name of fx:controller attribute of a root.

public static final String
FX_FACTORY_ATTRIBUTE

The name of 'fx:factory' attribute.

public static final String
FX_ID_ATTRIBUTE

The name of fx:id attribute.

public static final String
FX_NAMESPACE_PREFIX

Prefix of 'fx' namespace.

public static final String
FX_NAMESPACE_VERSION

Contains the current fx namespace version.

public static final String
FX_VALUE_ATTRIBUTE

The name of fx:value attribute.

public static final String
IMPORT_PROCESSING_INSTRUCTION

The tag name of import processing instruction.

public static final String
INCLUDE_CHARSET_ATTRIBUTE

The <fx:include> 'charset' attribute.

public static final String
INCLUDE_RESOURCES_ATTRIBUTE

The <fx:include> 'resources' attribute.

public static final String
INCLUDE_SOURCE_ATTRIBUTE

The <fx:include> 'source' attribute.

public static final String
INCLUDE_TAG

The tag name of <fx:include>.

public static final String
INITIALIZE_METHOD_NAME

The name of initialize method.

public static final String
JAVAFX_VERSION

Contains the current javafx version.

public static final String
LANGUAGE_PROCESSING_INSTRUCTION

The tag name of language processing instruction.

private final LinkedList<FXMLLoader>
private LoadListener
private URL
public static final String
LOCATION_KEY

A key for location URL in namespace map.

private ObservableMap<String, Object>
public static final String
NULL_KEYWORD

Value that represents 'null'.

private List<String>
private FXMLLoader
public static final String
REFERENCE_SOURCE_ATTRIBUTE

The <fx:reference> 'source' attribute.

public static final String
REFERENCE_TAG

The tag name of <fx:reference>.

public static final String
RELATIVE_PATH_PREFIX

Prefix for relative location resolution.

public static final String
RESOURCE_KEY_PREFIX

Prefix for resource resolution.

private ResourceBundle
public static final String
RESOURCES_KEY

A key for ResourceBundle in namespace map.

private Object
public static final String
ROOT_TAG

The tag name of <fx:root>.

public static final String
ROOT_TYPE_ATTRIBUTE

The <fx:root> 'type' attribute.

public static final String
SCRIPT_CHARSET_ATTRIBUTE

The <fx:script> 'charset' attribute.

public static final String
SCRIPT_SOURCE_ATTRIBUTE

The <fx:script> 'source' attribute.

public static final String
SCRIPT_TAG

The tag name of <fx:script>.

private ScriptEngine
private ScriptEngineManager
private boolean
private XMLStreamReader

Constructor Summary

AccessConstructor and Description
public
FXMLLoader()

Creates a new FXMLLoader instance.

public
FXMLLoader(URL
the location used to resolve relative path attribute values
location
)

Creates a new FXMLLoader instance.

public
FXMLLoader(URL
the location used to resolve relative path attribute values
location
,
ResourceBundle
the resources used to resolve resource key attribute values
resources
)

Creates a new FXMLLoader instance.

public
FXMLLoader(URL
the location used to resolve relative path attribute values
location
,
ResourceBundle
resources used to resolve resource key attribute values
resources
,
BuilderFactory
the builder factory used by this loader
builderFactory
)

Creates a new FXMLLoader instance.

public
FXMLLoader(URL
the location used to resolve relative path attribute values
location
,
ResourceBundle
resources used to resolve resource key attribute values
resources
,
BuilderFactory
the builder factory used by this loader
builderFactory
,
Callback<Class<?>, Object>
the controller factory used by this loader
controllerFactory
)

Creates a new FXMLLoader instance.

public
FXMLLoader(Charset
the character set used by this loader
charset
)

Creates a new FXMLLoader instance.

public
FXMLLoader(URL
the location used to resolve relative path attribute values
location
,
ResourceBundle
resources used to resolve resource key attribute values
resources
,
BuilderFactory
the builder factory used by this loader
builderFactory
,
Callback<Class<?>, Object>
the controller factory used by this loader
controllerFactory
,
Charset
the character set used by this loader
charset
)

Creates a new FXMLLoader instance.

public
FXMLLoader(URL
the location used to resolve relative path attribute values
location
,
ResourceBundle
resources used to resolve resource key attribute values
resources
,
BuilderFactory
the builder factory used by this loader
builderFactory
,
Callback<Class<?>, Object>
the controller factory used by this loader
controllerFactory
,
Charset
the character set used by this loader
charset
,
LinkedList<FXMLLoader>
list of loaders
loaders
)

Creates a new FXMLLoader instance.

Method Summary

Modifier and TypeMethod and Description
private void
pack-priv static int

Returns:

number < 0 if runtime version is lower, 0 when both versions are the same, number > 0 if runtime is higher version
compareJFXVersions
(String
String representation of JavaFX runtime version, including - or _ appendix
rtVer
,
String
String representation of JavaFX version to compare against runtime version
nsVer
)

Utility method for comparing two JavaFX version strings (such as 2.2.5, 8.0.0-ea)

private String
private LoadException
private LoadException
private LoadException
private void
public boolean
equals(Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public BuilderFactory

Returns:

the builder factory
getBuilderFactory
()

Returns the builder factory used by this loader.

public Charset

Returns:

the character set
getCharset
()

Returns the character set used by this loader.

public ClassLoader

Returns:

the classloader
getClassLoader
()

Returns the classloader used by this loader.

public <
the type of the controller
T
>
T

Returns:

the controller associated with the root object
getController
()

Returns the controller associated with the root object.

public Callback<Class<?>, Object>

Returns:

the controller factory
getControllerFactory
()

Returns the controller factory used by this loader.

private static ClassLoader
public static ClassLoader

Returns:

the default class loader
getDefaultClassLoader
()

Returns the default class loader.

pack-priv int
getLineNumber()

Returns the current line number.

public LoadListener

Returns:

the load listener
getLoadListener
()

Returns this loader's load listener.

public URL

Returns:

the location used to resolve relative path attribute values
getLocation
()

Returns the location used to resolve relative path attribute values.

public ObservableMap<String, Object>

Returns:

the namespace
getNamespace
()

Returns the namespace used by this loader.

pack-priv ParseTraceElement[]
getParseTrace()

Returns the current parse trace.

public ResourceBundle

Returns:

the resources used to resolve resource key attribute values
getResources
()

Returns the resources used to resolve resource key attribute values.

public <
the type of the root object
T
>
T

Returns:

the root of the object hierarchy
getRoot
()

Returns the root of the object hierarchy.

private ScriptEngineManager
private Class<?>
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

private void
private void
private void
injectFields(String fieldName, Object value)

private boolean
isCyclic(FXMLLoader currentLoader, FXMLLoader node)

private boolean
pack-priv boolean
public <
the type of the root object
T
>
T

Returns:

the loaded object hierarchy
load
()

Loads an object hierarchy from a FXML document.

public <
the type of the root object
T
>
T

Returns:

the loaded object hierarchy
load
(InputStream
an input stream containing the FXML data to load
inputStream
)

Loads an object hierarchy from a FXML document.

public static <
the type of the root object
T
>
T

Returns:

the loaded object hierarchy
load
(URL
the location used to resolve relative path attribute values
location
)

Loads an object hierarchy from a FXML document.

public static <
the type of the root object
T
>
T

Returns:

the loaded object hierarchy
load
(URL
the location used to resolve relative path attribute values
location
,
ResourceBundle
the resources used to resolve resource key attribute values
resources
)

Loads an object hierarchy from a FXML document.

public static <
the type of the root object
T
>
T

Returns:

the loaded object hierarchy
load
(URL
the location used to resolve relative path attribute values
location
,
ResourceBundle
the resources used to resolve resource key attribute values
resources
,
BuilderFactory
the builder factory used to load the document
builderFactory
)

Loads an object hierarchy from a FXML document.

public static <
the type of the root object
T
>
T

Returns:

the loaded object hierarchy
load
(URL
the location used to resolve relative path attribute values
location
,
ResourceBundle
the resources used to resolve resource key attribute values
resources
,
BuilderFactory
the builder factory used when loading the document
builderFactory
,
Callback<Class<?>, Object>
the controller factory used when loading the document
controllerFactory
)

Loads an object hierarchy from a FXML document.

public static <
the type of the root object
T
>
T

Returns:

the loaded object hierarchy
load
(URL
the location used to resolve relative path attribute values
location
,
ResourceBundle
the resources used to resolve resource key attribute values
resources
,
BuilderFactory
the builder factory used when loading the document
builderFactory
,
Callback<Class<?>, Object>
the controller factory used when loading the document
controllerFactory
,
Charset
the character set used when loading the document
charset
)

Loads an object hierarchy from a FXML document.

private <T> T
loadImpl(final Class<?> callerClass)

private <T> T
loadImpl(InputStream inputStream, Class<?> callerClass)

private static <T> T
loadImpl(URL location, Class<?> callerClass)

private static <T> T
loadImpl(URL location, ResourceBundle resources, Class<?> callerClass)

private static <T> T
loadImpl(URL location, ResourceBundle resources, BuilderFactory builderFactory, Class<?> callerClass)

private static <T> T
loadImpl(URL location, ResourceBundle resources, BuilderFactory builderFactory, Callback<Class<?>, Object> controllerFactory, Class<?> callerClass)

private static <T> T
loadImpl(URL location, ResourceBundle resources, BuilderFactory builderFactory, Callback<Class<?>, Object> controllerFactory, Charset charset, Class<?> callerClass)

private Class<?>
loadType(String name, boolean cache)

public static Class<?>

Returns:

the class
loadType
(String
the package name of the class to load
packageName
,
String
the name of the class to load
className
)
Deprecated This method now delegates to getDefaultClassLoader().

Loads a type using the default class loader.

public static Class<?>

Returns:

the class
loadType
(String
the name of the class to load
className
)
Deprecated This method now delegates to getDefaultClassLoader().

Loads a type using the default class loader.

private Class<?>
loadTypeForPackage(String packageName, String className)

private void
private void
private void
private void
private void
private void
private void
public void
setBuilderFactory(BuilderFactory
the builder factory
builderFactory
)

Sets the builder factory used by this loader.

public void
setCharset(Charset
the character set
charset
)

Sets the character set used by this loader.

public void
setClassLoader(ClassLoader
the classloader
classLoader
)

Sets the classloader used by this loader and clears any existing imports.

public void
setController(Object
the controller to associate with the root object
controller
)

Sets the controller associated with the root object.

public void
setControllerFactory(Callback<Class<?>, Object>
the controller factory
controllerFactory
)

Sets the controller factory used by this loader.

public static void
setDefaultClassLoader(ClassLoader
The default class loader to use when loading classes.
defaultClassLoader
)

Sets the default class loader.

public final void
setLoadListener(LoadListener
the load listener
loadListener
)

Sets this loader's load listener.

public void
setLocation(URL
the location
location
)

Sets the location used to resolve relative path attribute values.

public void
setResources(ResourceBundle
the resources
resources
)

Sets the resources used to resolve resource key attribute values.

public void
setRoot(Object
the root of the object hierarchy
root
)

Sets the root of the object hierarchy.

pack-priv void
setStaticLoad(boolean staticLoad)

private static FXMLLoader.SupportedType
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait