public abstract class AbstractFileElementType extends AbstractElementType<File> implements Component, Serviceable, Configurable
Modifier and Type | Field and Description |
---|---|
protected static String |
__EXPLORER_FILE_TYPE
Type of he file from explorer
|
protected String |
_binaryType
Type of the binary
|
protected AmetysObjectResolver |
_resolver
Ametys object resolver
|
Constructor and Description |
---|
AbstractFileElementType() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
_hasAmetysObjectsForIdentifiers(String... identifiers)
Check if ametys objects exist with the given identifiers
|
File |
castValue(String value)
Cast an untyped value (string) to an object of the corresponding type
|
void |
configure(Configuration configuration) |
Object |
fromJSONForClient(Object json)
Convert the given client side JSON object to the types value
|
boolean |
isSimple()
Determines if this type is simple or not.
|
File |
parseConfiguration(Configuration configuration)
Parses the given configuration to get the typed value
|
void |
service(ServiceManager manager) |
String |
toString(File value)
Cast a typed value to a String
|
Object |
valueToJSONForClient(Object value)
Convert the value into a JSON object to use client side
|
void |
valueToSAX(ContentHandler contentHandler,
String tagName,
Object value,
Locale locale)
Generates SAX events for the given value
|
_singleValueToJSON, _singleValueToSAX, getManagedClass, getManagedClassArray, isCompatible
getId, setPluginInfo
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getId
setPluginInfo
protected static final String __EXPLORER_FILE_TYPE
protected AmetysObjectResolver _resolver
protected String _binaryType
public AbstractFileElementType()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public void configure(Configuration configuration) throws ConfigurationException
configure
in interface Configurable
ConfigurationException
public File castValue(String value) throws BadItemTypeException
ElementType
castValue
in interface ElementType<File>
value
- the value to castBadItemTypeException
- if the String value can't be cast to the typepublic String toString(File value)
ElementType
toString
in interface ElementType<File>
toString
in class AbstractElementType<File>
value
- the value to castpublic void valueToSAX(ContentHandler contentHandler, String tagName, Object value, Locale locale) throws SAXException
ModelItemType
valueToSAX
in interface ModelItemType
valueToSAX
in class AbstractElementType<File>
contentHandler
- the ContentHandler
that will receive the SAX eventstagName
- the tag name of the SAX event to generate.value
- the value to SAXlocale
- The locale to use for localized data. Can be null
to generate SAX events for all existing Locale
s.SAXException
- if an error occurs during the SAX events generationpublic File parseConfiguration(Configuration configuration) throws ConfigurationException
ElementType
parseConfiguration
in interface ElementType<File>
parseConfiguration
in class AbstractElementType<File>
configuration
- the configuration to parseConfigurationException
- if an error occurs while parsing the configurationpublic Object valueToJSONForClient(Object value)
ElementType
valueToJSONForClient
in interface ElementType<File>
valueToJSONForClient
in class AbstractElementType<File>
value
- the value to convertpublic Object fromJSONForClient(Object json)
ElementType
fromJSONForClient
in interface ElementType<File>
json
- the JSON object to convertpublic boolean isSimple()
ElementType
isSimple
in interface ElementType<File>
true
if the type is simple, false
otherwiseprotected boolean _hasAmetysObjectsForIdentifiers(String... identifiers)
identifiers
- the identifierstrue
if ametys object exist for each identifier, false
otherwise