public class FXMLLoader
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ARRAY_COMPONENT_DELIMITER
Delimiter for arrays as values
|
static java.lang.String |
BI_DIRECTIONAL_BINDING_PREFIX
Prefix for bidirectional-binding expression resolution
|
static java.lang.String |
BI_DIRECTIONAL_BINDING_SUFFIX
Suffix for bidirectional-binding expression resolution
|
static java.lang.String |
BINDING_EXPRESSION_PREFIX
Prefix for binding expression resolution
|
static java.lang.String |
BINDING_EXPRESSION_SUFFIX
Suffix for binding expression resolution
|
static java.lang.String |
CHANGE_EVENT_HANDLER_SUFFIX
Suffix for property change/invalidation handlers
|
static java.lang.String |
CONTROLLER_KEYWORD
A key for controller in namespace map
|
static java.lang.String |
CONTROLLER_METHOD_PREFIX
Prefix for controller method resolution
|
static java.lang.String |
CONTROLLER_SUFFIX
A suffix for controllers of included fxml files.
|
static java.lang.String |
COPY_SOURCE_ATTRIBUTE
<fx:copy> 'source' attribute
|
static java.lang.String |
COPY_TAG
The tag name of <fx:copy>
|
static java.lang.String |
DEFAULT_CHARSET_NAME
The character set used when character set is not explicitly specified
|
static java.lang.String |
DEFINE_TAG
The tag name of <fx:define>
|
static java.lang.String |
ESCAPE_PREFIX
Escape prefix for escaping special characters inside attribute values.
|
static java.lang.String |
EVENT_HANDLER_PREFIX
The prefix of event handler attributes
|
static java.lang.String |
EVENT_KEY
The name of the Event object in event handler scripts
|
static java.lang.String |
EXPRESSION_PREFIX
Prefix for (variable) expression resolution
|
static java.lang.String |
FX_CONSTANT_ATTRIBUTE
The tag name of 'fx:constant'
|
static java.lang.String |
FX_CONTROLLER_ATTRIBUTE
The name of fx:controller attribute of a root
|
static java.lang.String |
FX_FACTORY_ATTRIBUTE
The name of 'fx:factory' attribute
|
static java.lang.String |
FX_ID_ATTRIBUTE
The name of fx:id attribute
|
static java.lang.String |
FX_NAMESPACE_PREFIX
Prefix of 'fx' namespace
|
static java.lang.String |
FX_NAMESPACE_VERSION
Contains the current fx namepsace version
|
static java.lang.String |
FX_VALUE_ATTRIBUTE
The name of fx:value attribute
|
static java.lang.String |
IMPORT_PROCESSING_INSTRUCTION
The tag name of import processing instruction
|
static java.lang.String |
INCLUDE_CHARSET_ATTRIBUTE
<fx:include> 'charset' attribute
|
static java.lang.String |
INCLUDE_RESOURCES_ATTRIBUTE
<fx:include> 'resources' attribute
|
static java.lang.String |
INCLUDE_SOURCE_ATTRIBUTE
<fx:include> 'source' attribute
|
static java.lang.String |
INCLUDE_TAG
The tag name of <fx:include>
|
static java.lang.String |
INITIALIZE_METHOD_NAME
The name of initialize method
|
static java.lang.String |
JAVAFX_VERSION
Contains the current javafx version
|
static java.lang.String |
LANGUAGE_PROCESSING_INSTRUCTION
The tag name of language processing instruction
|
static java.lang.String |
LOCATION_KEY
A key for location URL in namespace map
|
static java.lang.String |
NULL_KEYWORD
Value that represents 'null'
|
static java.lang.String |
REFERENCE_SOURCE_ATTRIBUTE
<fx:reference> 'source' attribute
|
static java.lang.String |
REFERENCE_TAG
The tag name of <fx:reference>
|
static java.lang.String |
RELATIVE_PATH_PREFIX
Prefix for relative location resultion
|
static java.lang.String |
RESOURCE_KEY_PREFIX
Prefix for resource resolution
|
static java.lang.String |
RESOURCES_KEY
A key for ResourceBundle in namespace map
|
static java.lang.String |
ROOT_TAG
The tag name of <fx:root>
|
static java.lang.String |
ROOT_TYPE_ATTRIBUTE
<fx:root> 'type' attribute
|
static java.lang.String |
SCRIPT_CHARSET_ATTRIBUTE
<fx:script> 'charset' attribute
|
static java.lang.String |
SCRIPT_SOURCE_ATTRIBUTE
<fx:script> 'source' attribute
|
static java.lang.String |
SCRIPT_TAG
The tag name of <fx:script>
|
Constructor and Description |
---|
FXMLLoader()
Creates a new FXMLLoader instance.
|
FXMLLoader(java.nio.charset.Charset charset)
Creates a new FXMLLoader instance.
|
FXMLLoader(java.net.URL location)
Creates a new FXMLLoader instance.
|
FXMLLoader(java.net.URL location,
java.util.ResourceBundle resources)
Creates a new FXMLLoader instance.
|
FXMLLoader(java.net.URL location,
java.util.ResourceBundle resources,
BuilderFactory builderFactory)
Creates a new FXMLLoader instance.
|
FXMLLoader(java.net.URL location,
java.util.ResourceBundle resources,
BuilderFactory builderFactory,
Callback<java.lang.Class<?>,java.lang.Object> controllerFactory)
Creates a new FXMLLoader instance.
|
FXMLLoader(java.net.URL location,
java.util.ResourceBundle resources,
BuilderFactory builderFactory,
Callback<java.lang.Class<?>,java.lang.Object> controllerFactory,
java.nio.charset.Charset charset)
Creates a new FXMLLoader instance.
|
FXMLLoader(java.net.URL location,
java.util.ResourceBundle resources,
BuilderFactory builderFactory,
Callback<java.lang.Class<?>,java.lang.Object> controllerFactory,
java.nio.charset.Charset charset,
java.util.LinkedList<FXMLLoader> loaders)
Creates a new FXMLLoader instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
BuilderFactory |
getBuilderFactory()
Returns the builder factory used by this loader.
|
java.nio.charset.Charset |
getCharset()
Returns the character set used by this loader.
|
java.lang.ClassLoader |
getClassLoader()
Returns the classloader used by this serializer.
|
<T> T |
getController()
Returns the controller associated with the root object.
|
Callback<java.lang.Class<?>,java.lang.Object> |
getControllerFactory()
Returns the controller factory used by this serializer.
|
static java.lang.ClassLoader |
getDefaultClassLoader()
Returns the default class loader.
|
java.net.URL |
getLocation()
Returns the location used to resolve relative path attribute values.
|
ObservableMap<java.lang.String,java.lang.Object> |
getNamespace()
Returns the namespace used by this loader.
|
java.util.ResourceBundle |
getResources()
Returns the resources used to resolve resource key attribute values.
|
<T> T |
getRoot()
Returns the root of the object hierarchy.
|
<T> T |
load()
Loads an object hierarchy from a FXML document.
|
<T> T |
load(java.io.InputStream inputStream)
Loads an object hierarchy from a FXML document.
|
static <T> T |
load(java.net.URL location)
Loads an object hierarchy from a FXML document.
|
static <T> T |
load(java.net.URL location,
java.util.ResourceBundle resources)
Loads an object hierarchy from a FXML document.
|
static <T> T |
load(java.net.URL location,
java.util.ResourceBundle resources,
BuilderFactory builderFactory)
Loads an object hierarchy from a FXML document.
|
static <T> T |
load(java.net.URL location,
java.util.ResourceBundle resources,
BuilderFactory builderFactory,
Callback<java.lang.Class<?>,java.lang.Object> controllerFactory)
Loads an object hierarchy from a FXML document.
|
static <T> T |
load(java.net.URL location,
java.util.ResourceBundle resources,
BuilderFactory builderFactory,
Callback<java.lang.Class<?>,java.lang.Object> controllerFactory,
java.nio.charset.Charset charset)
Loads an object hierarchy from a FXML document.
|
static java.lang.Class<?> |
loadType(java.lang.String className)
Deprecated.
This method now delegates to
getDefaultClassLoader() . |
static java.lang.Class<?> |
loadType(java.lang.String packageName,
java.lang.String className)
Deprecated.
This method now delegates to
getDefaultClassLoader() . |
void |
setBuilderFactory(BuilderFactory builderFactory)
Sets the builder factory used by this loader.
|
void |
setCharset(java.nio.charset.Charset charset)
Sets the charset used by this loader.
|
void |
setClassLoader(java.lang.ClassLoader classLoader)
Sets the classloader used by this serializer and clears any existing
imports
|
void |
setController(java.lang.Object controller)
Sets the controller associated with the root object.
|
void |
setControllerFactory(Callback<java.lang.Class<?>,java.lang.Object> controllerFactory)
Sets the controller factory used by this serializer.
|
static void |
setDefaultClassLoader(java.lang.ClassLoader defaultClassLoader)
Sets the default class loader.
|
void |
setLocation(java.net.URL location)
Sets the location used to resolve relative path attribute values.
|
void |
setResources(java.util.ResourceBundle resources)
Sets the resources used to resolve resource key attribute values.
|
void |
setRoot(java.lang.Object root)
Sets the root of the object hierarchy.
|
public static final java.lang.String DEFAULT_CHARSET_NAME
public static final java.lang.String LANGUAGE_PROCESSING_INSTRUCTION
public static final java.lang.String IMPORT_PROCESSING_INSTRUCTION
public static final java.lang.String FX_NAMESPACE_PREFIX
public static final java.lang.String FX_CONTROLLER_ATTRIBUTE
public static final java.lang.String FX_ID_ATTRIBUTE
public static final java.lang.String FX_VALUE_ATTRIBUTE
public static final java.lang.String FX_CONSTANT_ATTRIBUTE
public static final java.lang.String FX_FACTORY_ATTRIBUTE
public static final java.lang.String INCLUDE_TAG
public static final java.lang.String INCLUDE_SOURCE_ATTRIBUTE
public static final java.lang.String INCLUDE_RESOURCES_ATTRIBUTE
public static final java.lang.String INCLUDE_CHARSET_ATTRIBUTE
public static final java.lang.String SCRIPT_TAG
public static final java.lang.String SCRIPT_SOURCE_ATTRIBUTE
public static final java.lang.String SCRIPT_CHARSET_ATTRIBUTE
public static final java.lang.String DEFINE_TAG
public static final java.lang.String REFERENCE_TAG
public static final java.lang.String REFERENCE_SOURCE_ATTRIBUTE
public static final java.lang.String ROOT_TAG
public static final java.lang.String ROOT_TYPE_ATTRIBUTE
public static final java.lang.String COPY_TAG
public static final java.lang.String COPY_SOURCE_ATTRIBUTE
public static final java.lang.String EVENT_HANDLER_PREFIX
public static final java.lang.String EVENT_KEY
public static final java.lang.String CHANGE_EVENT_HANDLER_SUFFIX
public static final java.lang.String NULL_KEYWORD
public static final java.lang.String ESCAPE_PREFIX
ESCAPE_PREFIX
, RELATIVE_PATH_PREFIX
,
#RESOURCE_KEY_PREFIX, {@link #EXPRESSION_PREFIX}, {@link #BI_DIRECTIONAL_BINDING_PREFIX}public static final java.lang.String RELATIVE_PATH_PREFIX
public static final java.lang.String RESOURCE_KEY_PREFIX
public static final java.lang.String EXPRESSION_PREFIX
public static final java.lang.String BINDING_EXPRESSION_PREFIX
public static final java.lang.String BINDING_EXPRESSION_SUFFIX
public static final java.lang.String BI_DIRECTIONAL_BINDING_PREFIX
public static final java.lang.String BI_DIRECTIONAL_BINDING_SUFFIX
public static final java.lang.String ARRAY_COMPONENT_DELIMITER
public static final java.lang.String LOCATION_KEY
getNamespace()
,
Constant Field Valuespublic static final java.lang.String RESOURCES_KEY
getNamespace()
,
Constant Field Valuespublic static final java.lang.String CONTROLLER_METHOD_PREFIX
public static final java.lang.String CONTROLLER_KEYWORD
getNamespace()
,
Constant Field Valuespublic static final java.lang.String CONTROLLER_SUFFIX
getNamespace()
,
Constant Field Valuespublic static final java.lang.String INITIALIZE_METHOD_NAME
public static final java.lang.String JAVAFX_VERSION
public static final java.lang.String FX_NAMESPACE_VERSION
public FXMLLoader()
public FXMLLoader(java.net.URL location)
location
- public FXMLLoader(java.net.URL location, java.util.ResourceBundle resources)
location
- resources
- public FXMLLoader(java.net.URL location, java.util.ResourceBundle resources, BuilderFactory builderFactory)
location
- resources
- builderFactory
- public FXMLLoader(java.net.URL location, java.util.ResourceBundle resources, BuilderFactory builderFactory, Callback<java.lang.Class<?>,java.lang.Object> controllerFactory)
location
- resources
- builderFactory
- controllerFactory
- public FXMLLoader(java.nio.charset.Charset charset)
charset
- public FXMLLoader(java.net.URL location, java.util.ResourceBundle resources, BuilderFactory builderFactory, Callback<java.lang.Class<?>,java.lang.Object> controllerFactory, java.nio.charset.Charset charset)
location
- resources
- builderFactory
- controllerFactory
- charset
- public FXMLLoader(java.net.URL location, java.util.ResourceBundle resources, BuilderFactory builderFactory, Callback<java.lang.Class<?>,java.lang.Object> controllerFactory, java.nio.charset.Charset charset, java.util.LinkedList<FXMLLoader> loaders)
location
- resources
- builderFactory
- controllerFactory
- charset
- loaders
- public java.net.URL getLocation()
public void setLocation(java.net.URL location)
location
- public java.util.ResourceBundle getResources()
public void setResources(java.util.ResourceBundle resources)
resources
- public ObservableMap<java.lang.String,java.lang.Object> getNamespace()
public <T> T getRoot()
public void setRoot(java.lang.Object root)
root
- The root of the object hierarchy.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public <T> T getController()
public void setController(java.lang.Object controller)
controller
- The controller to associate with the root object.public BuilderFactory getBuilderFactory()
public void setBuilderFactory(BuilderFactory builderFactory)
builderFactory
- public Callback<java.lang.Class<?>,java.lang.Object> getControllerFactory()
public void setControllerFactory(Callback<java.lang.Class<?>,java.lang.Object> controllerFactory)
controllerFactory
- public java.nio.charset.Charset getCharset()
public void setCharset(java.nio.charset.Charset charset)
charset
- public java.lang.ClassLoader getClassLoader()
public void setClassLoader(java.lang.ClassLoader classLoader)
classLoader
- public <T> T load() throws java.io.IOException
setLocation(URL)
.
When the "template" flag is set to false (the default), this method will clear the imports before loading the document's content. When "template" is true, the imports will not be cleared, and the root value will be set to null before the content is loaded. This helps improve performance on subsequent loads by eliminating the overhead of loading the classes referred to by the document.
java.io.IOException
public <T> T load(java.io.InputStream inputStream) throws java.io.IOException
inputStream
- An input stream containing the FXML data to load.java.io.IOException
public static java.lang.Class<?> loadType(java.lang.String packageName, java.lang.String className) throws java.lang.ClassNotFoundException
getDefaultClassLoader()
.packageName
- className
- java.lang.ClassNotFoundException
public static java.lang.Class<?> loadType(java.lang.String className) throws java.lang.ClassNotFoundException
getDefaultClassLoader()
.className
- java.lang.ClassNotFoundException
public static java.lang.ClassLoader getDefaultClassLoader()
public static void setDefaultClassLoader(java.lang.ClassLoader defaultClassLoader)
defaultClassLoader
- The default class loader to use when loading classes.public static <T> T load(java.net.URL location) throws java.io.IOException
location
- java.io.IOException
public static <T> T load(java.net.URL location, java.util.ResourceBundle resources) throws java.io.IOException
location
- resources
- java.io.IOException
public static <T> T load(java.net.URL location, java.util.ResourceBundle resources, BuilderFactory builderFactory) throws java.io.IOException
location
- resources
- builderFactory
- java.io.IOException
public static <T> T load(java.net.URL location, java.util.ResourceBundle resources, BuilderFactory builderFactory, Callback<java.lang.Class<?>,java.lang.Object> controllerFactory) throws java.io.IOException
location
- resources
- builderFactory
- controllerFactory
- java.io.IOException
public static <T> T load(java.net.URL location, java.util.ResourceBundle resources, BuilderFactory builderFactory, Callback<java.lang.Class<?>,java.lang.Object> controllerFactory, java.nio.charset.Charset charset) throws java.io.IOException
location
- resources
- builderFactory
- controllerFactory
- charset
- java.io.IOException
Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.