Package com.appiancorp.suiteapi.content
Class ContentBeanFactory
java.lang.Object
com.appiancorp.suiteapi.content.ContentBeanFactory
Provides utility methods for creating content objects based on the type identifiers.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Class
getContentClass
(Long type_) Gets the class of the content object associated with the type passed in.static Class
getContentClass
(Long type_, Long subtype_) Gets the class of the content object associated with the type and sub-type passed in.static Content
newContent
(Long type_) Creates a new Content object of the type specified.static Content
newContent
(Long type_, Long subtype_) Creates a new Content object of the type and sub-type specified.static void
setApplicationContentSubtypeClass
(int subtype_, Class customClass_) Registers the java class to be instantiated when retrieving application content objects of a given subtype.static void
setCustomContentSubtypeClass
(int subtype_, Class customClass_) Registers the java class to be instantiated when retrieving custom content objects of a given subtype.static void
setCustomContentSubtypeClassesMap
(Map subtypeToClass_) Sets all the custom content subtype class mappings.
-
Constructor Details
-
ContentBeanFactory
public ContentBeanFactory()
-
-
Method Details
-
setCustomContentSubtypeClass
Registers the java class to be instantiated when retrieving custom content objects of a given subtype. The class should extendCustomContent
.- Parameters:
subtype_
- The subtype of the custom content.customClass_
- The class to use for custom content of this subtype.
-
setApplicationContentSubtypeClass
Registers the java class to be instantiated when retrieving application content objects of a given subtype.- Parameters:
subtype_
- The subtype of the custom content.customClass_
- The class to use for custom content of this subtype.
-
setCustomContentSubtypeClassesMap
Sets all the custom content subtype class mappings.- Parameters:
subtypeToClass_
- A map of <Long, Class> entries, where the key is a custom content subtype, and the value is the java class to be instantiated when retrieving custom content of that subtype. The classes should extendCustomContent
.
-
newContent
Creates a new Content object of the type specified. Usesnull
as the sub-type.- Parameters:
type_
- the type of content to create- Returns:
- the Content object
- See Also:
-
newContent
Creates a new Content object of the type and sub-type specified.- Parameters:
type_
- the type of content to createsubtype_
- the subtype of content to create (may benull
)- Returns:
- the Content object
- See Also:
-
getContentClass
Gets the class of the content object associated with the type passed in. Each of the classes returned extendsContent
.- Parameters:
type_
- the content type- Returns:
- the associated class
- See Also:
-
getContentClass
Gets the class of the content object associated with the type and sub-type passed in. Each of the classes returned extendsContent
.- Parameters:
type_
- the content typesubtype_
- the content sub-type- Returns:
- the associated class
- See Also:
-