Java Code Examples for org.alfresco.util.ISO9075#encode()

The following examples show how to use org.alfresco.util.ISO9075#encode() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DocumentNavigator.java    From alfresco-repository with GNU Lesser General Public License v3.0 6 votes vote down vote up
public String getAttributeQName(Object o)
{
    QName qName = ((Property) o).qname;
    String escapedLocalName = ISO9075.encode(qName.getLocalName());
    if (EqualsHelper.nullSafeEquals(escapedLocalName, qName.getLocalName()))        
    {
        return qName.toString();
    }
    else
    {
        return QName.createQName(qName.getNamespaceURI(), escapedLocalName).toString();
    }
}
 
Example 2
Source File: DocumentNavigator.java    From alfresco-repository with GNU Lesser General Public License v3.0 6 votes vote down vote up
public String getElementQName(Object o)
{
    QName qName = ((ChildAssociationRef) o).getQName();
    if(qName == null)
    {
        return "";
    }
    String escapedLocalName = ISO9075.encode(qName.getLocalName());
    if (EqualsHelper.nullSafeEquals(escapedLocalName, qName.getLocalName()))        
    {
        return qName.toString();
    }
    else
    {
        return QName.createQName(qName.getNamespaceURI(), escapedLocalName).toString();
    }
}
 
Example 3
Source File: DocumentNavigator.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
public String getElementName(Object o)
{
    QName qName = ((ChildAssociationRef) o).getQName();
    if(qName == null)
    {
        return "";
    }
    return ISO9075.encode(qName.getLocalName());
}
 
Example 4
Source File: DocumentNavigator.java    From alfresco-repository with GNU Lesser General Public License v3.0 4 votes vote down vote up
public String getAttributeName(Object o)
{
    // Get the local name
    return ISO9075.encode(((Property) o).qname.getLocalName());
}
 
Example 5
Source File: Search.java    From alfresco-repository with GNU Lesser General Public License v3.0 2 votes vote down vote up
/**
 * Encode a string to ISO9075 - used to build valid paths for Lucene queries etc.
 * 
 * @param s     Value to encode
 * 
 * @return encoded value
 */
public String ISO9075Encode(String s)
{
    return ISO9075.encode(s);
}