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