public abstract class JahiaObject extends Object implements Serializable
Title: Root class for all Jahia objects that use object keys and that can be instantiated through those keys.
Description: Objects should derive from this class if they may be instantiated or referenced through ObjectKey instances.
Copyright: Copyright (c) 2002
Company: Jahia Ltd
| Modifier | Constructor and Description |
|---|---|
protected |
JahiaObject()
No arg constructor used for serialization compliance.
|
|
JahiaObject(ObjectKey objectKey)
Default constructor that sets the object's key.
|
| Modifier and Type | Method and Description |
|---|---|
static JahiaObject |
getInstance(ObjectKey objectKey)
Instance generator.
|
static JahiaObject |
getInstance(ObjectKey objectKey,
boolean forceLoadFromDB)
Instance generator.
|
static Object |
getInstanceAsObject(ObjectKey objectKey)
Instance generator.
|
static Object |
getInstanceAsObject(ObjectKey objectKey,
boolean forceLoadFromDB)
Instance generator.
|
ObjectKey |
getObjectKey()
Returns the object key that fully identifies the content object within
a Jahia system.
|
static void |
registerType(String type,
String className)
Registers a new type for a sub class of JahiaObject in the factory
hash table.
|
static void |
unregisterType(String type)
Removes a type registration.
|
protected ObjectKey objectKey
public JahiaObject(ObjectKey objectKey)
objectKey - the object key that uniquely identifies this instance
of JahiaObject.protected JahiaObject()
public static void registerType(String type, String className)
type - the name of the type, usually defined as a constant in the
equivalent ObjectKey sub class (such as ContentPageKey)className - the name of the class. Can be obtained with a called
similar to JahiaObject.class.getName() (replacing the JahiaObject
with the subclass of course.public static void unregisterType(String type)
type - the name of the type to unregisterpublic static JahiaObject getInstance(ObjectKey objectKey) throws ClassNotFoundException
objectKey - an ObjectKey instance for the object we want to retrieve
an instance of.ClassNotFoundException - if no class could be found for the type
passed in the object keypublic static JahiaObject getInstance(ObjectKey objectKey, boolean forceLoadFromDB) throws ClassNotFoundException
objectKey - an ObjectKey instance for the object we want to retrieve
an instance of.forceLoadFromDB - true, if object should not be returned from cacheClassNotFoundException - if no class could be found for the type
passed in the object keypublic static Object getInstanceAsObject(ObjectKey objectKey) throws ClassNotFoundException
objectKey - an ObjectKey instance for the object we want to retrieve
an instance of.ClassNotFoundException - if no class could be found for the type
passed in the object keypublic static Object getInstanceAsObject(ObjectKey objectKey, boolean forceLoadFromDB) throws ClassNotFoundException
objectKey - an ObjectKey instance for the object we want to retrieve
an instance of.forceLoadFromDB - true, if object should not be returned from cacheClassNotFoundException - if no class could be found for the type
passed in the object keypublic ObjectKey getObjectKey()
Copyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.