• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java JcrProperty类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中org.jcrom.annotations.JcrProperty的典型用法代码示例。如果您正苦于以下问题:Java JcrProperty类的具体用法?Java JcrProperty怎么用?Java JcrProperty使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

JcrProperty类属于org.jcrom.annotations包,在下文中一共展示了JcrProperty类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getPropertyName

点赞 2

import org.jcrom.annotations.JcrProperty; //导入依赖的package包/类
protected String getPropertyName(Field field) {
    JcrProperty jcrProperty = mapper.getJcrom().getAnnotationReader().getAnnotation(field, JcrProperty.class);
    String name = field.getName();
    if (!jcrProperty.name().equals(Mapper.DEFAULT_FIELDNAME)) {
        name = jcrProperty.name();
    }
    return name;
}
 

开发者ID:dooApp,
项目名称:jcromfx,
代码行数:9,
代码来源:PropertyMapper.java

示例2: getSerializedPropertyName

点赞 2

import org.jcrom.annotations.JcrProperty; //导入依赖的package包/类
String getSerializedPropertyName(Field field)
{
    JcrSerializedProperty jcrProperty = mapper.getJcrom().getAnnotationReader().getAnnotation(field, JcrSerializedProperty.class);
    String propertyName = field.getName();
    if (!jcrProperty.name().equals(JcrProperty.DEFAULT_FIELDNAME))
    {
        propertyName = jcrProperty.name();
    }
    return propertyName;
}
 

开发者ID:sbrinkmann,
项目名称:jcrom-extended,
代码行数:11,
代码来源:PropertyMapper.java

示例3: getPropertyName

点赞 2

import org.jcrom.annotations.JcrProperty; //导入依赖的package包/类
String getPropertyName(Field field)
{
    JcrProperty jcrProperty = mapper.getJcrom().getAnnotationReader().getAnnotation(field, JcrProperty.class);
    String name = field.getName();
    if (!jcrProperty.name().equals(JcrProperty.DEFAULT_FIELDNAME))
    {
        name = jcrProperty.name();
    }
    return name;
}
 

开发者ID:sbrinkmann,
项目名称:jcrom-extended,
代码行数:11,
代码来源:PropertyMapper.java

示例4: getProtectedPropertyName

点赞 2

import org.jcrom.annotations.JcrProperty; //导入依赖的package包/类
String getProtectedPropertyName(Field field)
{
    JcrProtectedProperty jcrProperty = mapper.getJcrom().getAnnotationReader().getAnnotation(field, JcrProtectedProperty.class);
    String name = field.getName();
    if (!jcrProperty.name().equals(JcrProperty.DEFAULT_FIELDNAME))
    {
        name = jcrProperty.name();
    }
    return name;
}
 

开发者ID:sbrinkmann,
项目名称:jcrom-extended,
代码行数:11,
代码来源:PropertyMapper.java

示例5: getPropertyName

点赞 2

import org.jcrom.annotations.JcrProperty; //导入依赖的package包/类
private String getPropertyName(Field field) {
    JcrReference jcrReference = mapper.getJcrom().getAnnotationReader().getAnnotation(field, JcrReference.class);
    String name = field.getName();
    if (!jcrReference.name().equals(JcrProperty.DEFAULT_FIELDNAME)) {
        name = jcrReference.name();
    }
    return name;
}
 

开发者ID:sbrinkmann,
项目名称:jcrom-extended,
代码行数:9,
代码来源:ReferenceMapper.java

示例6: getNodeName

点赞 2

import org.jcrom.annotations.JcrProperty; //导入依赖的package包/类
private String getNodeName(Field field) {
    JcrFileNode jcrFileNode = mapper.getJcrom().getAnnotationReader().getAnnotation(field, JcrFileNode.class);
    String name = field.getName();
    if (!jcrFileNode.name().equals(JcrProperty.DEFAULT_FIELDNAME)) {
        name = jcrFileNode.name();
    }
    return name;
}
 

开发者ID:sbrinkmann,
项目名称:jcrom-extended,
代码行数:9,
代码来源:FileNodeMapper.java

示例7: getNodeName

点赞 2

import org.jcrom.annotations.JcrProperty; //导入依赖的package包/类
private String getNodeName(Field field)
{
    JcrChildNode jcrChildNode = mapper.getJcrom().getAnnotationReader().getAnnotation(field, JcrChildNode.class);
    String name = field.getName();
    if (!jcrChildNode.name().equals(JcrProperty.DEFAULT_FIELDNAME))
    {
        name = jcrChildNode.name();
    }
    return name;
}
 

开发者ID:sbrinkmann,
项目名称:jcrom-extended,
代码行数:11,
代码来源:ChildNodeMapper.java

示例8: getDefaultValue

点赞 2

import org.jcrom.annotations.JcrProperty; //导入依赖的package包/类
Object getDefaultValue(Field field)
{
    JcrProperty jcrProperty = mapper.getJcrom().getAnnotationReader().getAnnotation(field, JcrProperty.class);
    return jcrProperty.defaultValue();
}
 

开发者ID:sbrinkmann,
项目名称:jcrom-extended,
代码行数:6,
代码来源:PropertyMapper.java

示例9: getPropertyRequired

点赞 2

import org.jcrom.annotations.JcrProperty; //导入依赖的package包/类
boolean getPropertyRequired(Field field)
{
    JcrProperty jcrProperty = mapper.getJcrom().getAnnotationReader().getAnnotation(field, JcrProperty.class);
    return jcrProperty.required();
}
 

开发者ID:sbrinkmann,
项目名称:jcrom-extended,
代码行数:6,
代码来源:PropertyMapper.java

示例10: getIsReadOnly

点赞 2

import org.jcrom.annotations.JcrProperty; //导入依赖的package包/类
boolean getIsReadOnly(Field field)
{
    JcrProperty jcrProperty = mapper.getJcrom().getAnnotationReader().getAnnotation(field, JcrProperty.class);
    return jcrProperty.readOnly();
}
 

开发者ID:sbrinkmann,
项目名称:jcrom-extended,
代码行数:6,
代码来源:PropertyMapper.java

示例11: mapPropertyToField

点赞 2

import org.jcrom.annotations.JcrProperty; //导入依赖的package包/类
boolean mapPropertyToField(Object obj, Field field, Node node, int depth, NodeFilter nodeFilter) throws RepositoryException, IllegalAccessException,
        IOException
{
    String name = getPropertyName(field);
    boolean nameIsARelativePath = name.contains("/");
    if(nameIsARelativePath)
    {
        int positionPathPropertyDelimiter = name.lastIndexOf("/");
        String relativePath = name.substring(0, positionPathPropertyDelimiter);
        if(node.hasNode(relativePath))
        {
            node = node.getNode(relativePath);
            name = name.substring(positionPathPropertyDelimiter + 1);
        }
    }
    
    if (nodeFilter == null || nodeFilter.isIncluded(NodeFilter.PROPERTY_PREFIX + field.getName(), node, depth))
    {
        if (ReflectionUtils.implementsInterface(field.getType(), Map.class))
        {
            // map of properties
            Class<?> valueType = ReflectionUtils.getParameterizedClass(field, 1);
            try
            {
                Node childrenContainer = node.getNode(name);
                PropertyIterator propIterator = childrenContainer.getProperties();
                mapPropertiesToMap(obj, field, valueType, propIterator, true);
            }
            catch (PathNotFoundException pne)
            {
                // ignore here as the Field could have been added to the model
                // since the Node was created and not yet been populated.
            }
        }
        else
        {
            mapToField(name, field, obj, node);
        }
    }

    Object defaultValue = getDefaultValue(field);
    if (field.get(obj) == null && !JcrProperty.DEFAULT_VALUE.equals(defaultValue))
    {
        try
        {
            field.set(obj, defaultValue);
        }
        catch (Exception e)
        {
            LOG.error("Error while mapping default value to field.", e);
        }
    }

    boolean propertyRequired = getPropertyRequired(field);
    return !propertyRequired || (propertyRequired && field.get(obj) != null);
}
 

开发者ID:sbrinkmann,
项目名称:jcrom-extended,
代码行数:57,
代码来源:PropertyMapper.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)