|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hippoecm.hst.util.ObjectConverterUtils
public class ObjectConverterUtils
ObjectConverterUtils
Method Summary | |
---|---|
static ObjectConverter |
createObjectConverter(Collection<Class<? extends HippoBean>> annotatedClasses)
Creates ObjectConverter , with ignoreDuplicates = false, which means that when there are two annotated beans with the same
value for Node.jcrType() , an IllegalArgumentException is thrown. |
static ObjectConverter |
createObjectConverter(Collection<Class<? extends HippoBean>> annotatedClasses,
boolean ignoreDuplicates)
Creates ObjectConverter . |
static ObjectConverter |
createObjectConverter(Collection<Class<? extends HippoBean>> annotatedClasses,
Class<? extends HippoBean>[] builtInMappingClasses,
String[] fallbackNodeTypes,
boolean ignoreDuplicates)
Creates ObjectConverter . |
static List<Class<? extends HippoBean>> |
getAnnotatedClasses(ClasspathResourceScanner resourceScanner,
String... locationPatterns)
Collects bean classes annotated by Node
from the location specified by locationPattern . |
static List<Class<? extends HippoBean>> |
getAnnotatedClasses(URL url)
Collects bean classes annotated by Node from a XML Resource URL. |
static String[] |
getDefaultFallbackNodeTypes()
Returns the default built-in fallback jcr primary node types |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ObjectConverter createObjectConverter(Collection<Class<? extends HippoBean>> annotatedClasses) throws IllegalArgumentException
ObjectConverter
, with ignoreDuplicates = false, which means that when there are two annotated beans with the same
value for Node.jcrType()
, an IllegalArgumentException is thrown.
annotatedClasses
- Annotated class mapping against jcr primary node types.
annotatedClasses
IllegalArgumentException
- when two annotatedClasses have the same Node.jcrType()
public static ObjectConverter createObjectConverter(Collection<Class<? extends HippoBean>> annotatedClasses, boolean ignoreDuplicates) throws IllegalArgumentException
ObjectConverter
.
annotatedClasses
- Annotated class mapping against jcr primary node types.ignoreDuplicates
- Flag whether duplicate mapping for a node type is ignored or not. If it is false, it throws IllegalArgumentException
on duplicate mappings.
annotatedClasses
IllegalArgumentException
- when two annotatedClasses have the same Node.jcrType()
and ignoreDuplicates
is falsepublic static ObjectConverter createObjectConverter(Collection<Class<? extends HippoBean>> annotatedClasses, Class<? extends HippoBean>[] builtInMappingClasses, String[] fallbackNodeTypes, boolean ignoreDuplicates) throws IllegalArgumentException
ObjectConverter
.
annotatedClasses
- Annotated class mapping against jcr primary node types.builtInMappingClasses
- Built-in class mappings against the default built-in jcr primary node types.fallbackNodeTypes
- If no bean found for the node type, a fallback node type is to be selected as ordered by using node.isNodeType(fallbackNodeType)
ignoreDuplicates
- Flag whether duplicate mapping for a node type is ignored or not. If it is false, it throws IllegalArgumentException
on duplicate mappings.
IllegalArgumentException
public static String[] getDefaultFallbackNodeTypes()
public static List<Class<? extends HippoBean>> getAnnotatedClasses(URL url) throws IOException, SAXException, ParserConfigurationException
Node
from a XML Resource URL.
Each annotated class name must be written inside <annotated-class/>
element
as child of the root element, <hst-content-beans/>,
like the following example:
org.hippoecm.hst.demo.beans.TextBean org.hippoecm.hst.demo.beans.NewsBean org.hippoecm.hst.demo.beans.ProductBean org.hippoecm.hst.demo.beans.CommentBean org.hippoecm.hst.demo.beans.CommentLinkBean org.hippoecm.hst.demo.beans.ImageLinkBean
url
-
IOException
SAXException
ParserConfigurationException
public static List<Class<? extends HippoBean>> getAnnotatedClasses(ClasspathResourceScanner resourceScanner, String... locationPatterns) throws IOException, SAXException, ParserConfigurationException
Node
from the location specified by locationPattern
.
Class resources will be collected by the specified resourceScanner
.
resourceScanner
- locationPatterns
-
IOException
SAXException
ParserConfigurationException
ClasspathResourceScanner}
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |