从以下代码中解析树图中的字符串

时间:2017-01-29 17:41:39

标签: java intellij-idea hashmap treemap

我用这种方式调用类和对象仍然无法弄清楚正确的概念是什么错误

public class MMTUtil{
    private static Map<String, String> domainDocumentationMap = null;

    static{
        domainDocumentationMap = new TreeMap<String, String>();
    }

    public static Map<String, String> getDomainDocumentationMap() {
        return domainDocumentationMap;
    }

    public static void setDomainDocumentationMap(Map<String, String> domainDocumentationMap) {
        MMTUtil.domainDocumentationMap = domainDocumentationMap;
    }

如何有效地使用setDomainDocumentationgetDomainDocumentation代码,以便我的Treemap具有以下一组值

  

(objectType + objectname,DocumentationLink)

public UMRResultObject insertDocumentation(UMRDocumentationDTO documentationDTO)
{
    Session session = UMRHibernateUtil.getUmrSession();
    Transaction tx = null;
    documentationLink = null;
    objectName = null;
    objectType = null;

    try{
        tx = session.beginTransaction();
        dao.insertDocumentation(documentationDTO, session);

        MMTUtil.getDomainDocumentationMap().put(objectName.getDomainName()+objectType.getDomainType(),documentationLink.getDocumentationLink());
        tx.commit();
        ro.setSuccess(true);
        ro.getMessages().add("Record Inserted Successfully");
    }
}

0 个答案:

没有答案