當前位置: 首頁>>代碼示例>>Java>>正文


Java Attribute.getStringValue方法代碼示例

本文整理匯總了Java中org.dom4j.Attribute.getStringValue方法的典型用法代碼示例。如果您正苦於以下問題:Java Attribute.getStringValue方法的具體用法?Java Attribute.getStringValue怎麽用?Java Attribute.getStringValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.dom4j.Attribute的用法示例。


在下文中一共展示了Attribute.getStringValue方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initialise

import org.dom4j.Attribute; //導入方法依賴的package包/類
public void initialise(Element element, NamespacePrefixResolver nspr, PermissionModel permissionModel)
{
    Attribute recipientAttribute = element.attribute(RECIPIENT);
    if (recipientAttribute != null)
    {
        recipient = recipientAttribute.getStringValue();
    }
    else
    {
        recipient = null;
    }

    Attribute accessAttribute = element.attribute(ACCESS);
    if (accessAttribute != null)
    {
        if (accessAttribute.getStringValue().equalsIgnoreCase(ALLOW))
        {
            access = AccessStatus.ALLOWED;
        }
        else if (accessAttribute.getStringValue().equalsIgnoreCase(DENY))
        {
            access = AccessStatus.DENIED;
        }
        else
        {
            throw new PermissionModelException("The default permission must be deny or allow");
        }
    }
    else
    {
        access = AccessStatus.DENIED;
    }
    
    
    Element permissionReferenceElement = element.element(PERMISSION_REFERENCE);
    QName typeQName = QName.createQName(permissionReferenceElement.attributeValue(TYPE), nspr);
    String name = permissionReferenceElement.attributeValue(NAME);
    permissionReference = PermissionReferenceImpl.getPermissionReference(typeQName, name);
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:40,代碼來源:ModelPermissionEntry.java

示例2: initialise

import org.dom4j.Attribute; //導入方法依賴的package包/類
public void initialise(Element element, NamespacePrefixResolver nspr, PermissionModel permissionModel)
{
   Attribute nodeRefAttribute = element.attribute(NODE_REF);
   if(nodeRefAttribute != null)
   {
       nodeRef = new NodeRef(nodeRefAttribute.getStringValue());
   }
   
   Attribute inheritFromParentAttribute = element.attribute(INHERIT_FROM_PARENT);
   if(inheritFromParentAttribute != null)
   {
       inheritPermissionsFromParent = Boolean.parseBoolean(inheritFromParentAttribute.getStringValue());
   }
   else
   {
       inheritPermissionsFromParent = true;
   }
   
   // Node Permissions Entry

   for (Iterator npit = element.elementIterator(NODE_PERMISSION); npit.hasNext(); /**/)
   {
       Element permissionEntryElement = (Element) npit.next();
       ModelPermissionEntry permissionEntry = new ModelPermissionEntry(nodeRef);
       permissionEntry.initialise(permissionEntryElement, nspr, permissionModel);
       permissionEntries.add(permissionEntry);
   }
    
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:30,代碼來源:NodePermission.java

示例3: initialise

import org.dom4j.Attribute; //導入方法依賴的package包/類
public void initialise(Element element, NamespacePrefixResolver nspr, PermissionModel permissionModel)
{
    Attribute authorityAttribute = element.attribute(AUTHORITY);
    if(authorityAttribute != null)
    {
        authority = authorityAttribute.getStringValue();
    }
    Attribute permissionAttribute = element.attribute(PERMISSION);
    if(permissionAttribute != null)
    {
        permissionReference = permissionModel.getPermissionReference(null, permissionAttribute.getStringValue());
    }

}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:15,代碼來源:GlobalPermissionEntry.java


注:本文中的org.dom4j.Attribute.getStringValue方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。