当前位置: 首页>>代码示例>>Java>>正文


Java Property.getBoolean方法代码示例

本文整理汇总了Java中javax.jcr.Property.getBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java Property.getBoolean方法的具体用法?Java Property.getBoolean怎么用?Java Property.getBoolean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.jcr.Property的用法示例。


在下文中一共展示了Property.getBoolean方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getTasksComplete

import javax.jcr.Property; //导入方法依赖的package包/类
public void getTasksComplete(Card card) throws Exception {
    ObjectContentManager ocm = ocmFactory.getOcm();
    try{	        
    	
     Node node = ocm.getSession().getNode(String.format(URI.TASKS_URI, card.getBoard(), card.getPhase(), card.getId().toString(),""));  
     int complete = 0;
     NodeIterator nodes = node.getNodes();
     while(nodes.hasNext()){
         Node nextNode = nodes.nextNode();
         Property property = nextNode.getProperty("complete");
         if( property!=null && property.getBoolean() ){
         	complete++;
         }
     }
     card.setCompleteTasks(Long.valueOf(complete));
     
    } finally {
    	ocm.logout();
    }              
}
 
开发者ID:cheetah100,项目名称:gravity,代码行数:21,代码来源:PhaseController.java

示例2: getRealValue

import javax.jcr.Property; //导入方法依赖的package包/类
public Object getRealValue(Property property) throws ValueFormatException,
		RepositoryException {
	Object value = null;

	switch (property.getType()) {
	case PropertyType.BOOLEAN:
		value = property.getBoolean();
		break;
	case PropertyType.DATE:
		value = property.getDate().getTime();
		break;
	case PropertyType.STRING:
		value = property.getString();
		break;
	case PropertyType.LONG:
		value = property.getLong();
		break;
	case PropertyType.DECIMAL:
		value = property.getDecimal();
		break;
	default:
		value = null;
	}
	return value;
}
 
开发者ID:cheetah100,项目名称:gravity,代码行数:26,代码来源:CardToolsImpl.java

示例3: setAction

import javax.jcr.Property; //导入方法依赖的package包/类
private void setAction(final Node node, Node actions, String actionName, String implClass) throws RepositoryException, PathNotFoundException, ValueFormatException, VersionException, LockException, ConstraintViolationException, ItemExistsException, AccessDeniedException {
    String propName = "default" + StringUtils.capitalize(actionName);
    if (node.hasProperty(propName)) {
        Property defaultAction = node.getProperty(propName);
        if (defaultAction.getBoolean()) {
            actions.addNode(actionName, NodeTypes.ContentNode.NAME).setProperty("class", implClass);
        }
        defaultAction.remove();
    }
}
 
开发者ID:rah003,项目名称:neat-tweaks,代码行数:11,代码来源:SaveDialogFormAction.java

示例4: getTaskSummary

import javax.jcr.Property; //导入方法依赖的package包/类
@PreAuthorize("hasPermission(#boardId, 'BOARD', 'READ,WRITE,ADMIN')")
@RequestMapping(value = "/{cardId}/tasksummary", method=RequestMethod.GET)
   public @ResponseBody Map<String,Integer> getTaskSummary(@PathVariable String boardId,
                                                       @PathVariable String phaseId,
                                                       @PathVariable String cardId) throws Exception {

       ObjectContentManager ocm = ocmFactory.getOcm();
       Map<String,Integer> result;
       try{
      
        Node node = ocm.getSession().getNode(String.format(URI.TASKS_URI, boardId, phaseId, cardId,""));
       
        int complete = 0;
        int incomplete = 0;
        int all = 0;
       
        NodeIterator nodes = node.getNodes();
        while(nodes.hasNext()){
            Node nextNode = nodes.nextNode();
            Property property = nextNode.getProperty("complete");
            if( property!=null){
                all++;
                if( property.getBoolean() ){
                    complete++;
                } else {
                    incomplete++;
                }
            }
        }
        result = new HashMap<String,Integer>();
        result.put("complete", complete);
        result.put("incomplete", incomplete);
        result.put("all", all);
        	        
       } finally {
       	ocm.logout();
       }
      
       return result;       
   }
 
开发者ID:cheetah100,项目名称:gravity,代码行数:41,代码来源:CardController.java

示例5: readBooleanProperty

import javax.jcr.Property; //导入方法依赖的package包/类
public static boolean readBooleanProperty(final Node node, final String name) throws RepositoryException {
    if (node.hasProperty(name)) {
        final Property property = node.getProperty(name);
        return property.getBoolean();
    }
    return false;
}
 
开发者ID:machak,项目名称:intelij-hippo-groovy,代码行数:8,代码来源:Util.java

示例6: distill

import javax.jcr.Property; //导入方法依赖的package包/类
/**
 * Extract property based on their type and return as object (of Property)
 *
 * @param property This is a property
 * @return content This is node property object
 * @throws Exception
 */
public static Object distill(Property property)
        throws Exception {
    Object content;
    boolean isMulti = property.isMultiple();
    switch (property.getType()) {
        case PropertyType.LONG:
            if (isMulti)
                content = asLongs(property);
            else
                content = property.getLong();
            break;
        case PropertyType.DECIMAL:
        case PropertyType.DOUBLE:
            if (isMulti)
                content = asDoubles(property);
            else
                content = property.getDouble();
            break;
        case PropertyType.BOOLEAN:
            if (isMulti)
                content = asBooleans(property);
            else
                content = property.getBoolean();
            break;
        case PropertyType.DATE:
            if (isMulti)
                content = asDates(property);
            else
                content = property.getValue().getString();
            break;
        case PropertyType.NAME:
        case PropertyType.STRING:
        case PropertyType.PATH:
        case PropertyType.URI:
        default:
            if (isMulti)
                content = asStrings(property);
            else
                content = property.getString();
            break;
    }
    return content;
}
 
开发者ID:DantaFramework,项目名称:AEM,代码行数:51,代码来源:PropertyUtils.java

示例7: getPropertyBoolean

import javax.jcr.Property; //导入方法依赖的package包/类
/**
 * Convenience method for getting a single-value boolean property from
 * a resource.
 *
 * @param resource The resource from which to get the property.
 * @param namePattern Property name.
 * @return Property value if present, else false.
 */
public static boolean getPropertyBoolean(Resource resource, String namePattern) throws RepositoryException {
    Property prop = getProperty(resource, namePattern);
    return prop != null && prop.getBoolean();
}
 
开发者ID:HS2-SOLUTIONS,项目名称:hs2-aem-commons,代码行数:13,代码来源:ResourceUtil.java


注:本文中的javax.jcr.Property.getBoolean方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。