Idea plug-in development

Source: Internet
Author: User

External services or interfaces that provide external services are often used in projects. In this case, return parameters must be escaped to avoid the impact of external objects on internal systems. For example, the interface datato getmydate () returns a value of datato. I need to convert it to our internal object datado. In this way, even if the datato provided by the business side changes, the impact on our internal system can be minimized. In this way, you need to write a conversion method from datato to datado, which is usually copying attributes, similar:

public static DataDO toDataDO(DataTO dataTO) {        if (dataTO == null) {            return null;        }        DataDO DataDO = new DataDO();        DataDO.setPlname(dataTO.getPlname());        DataDO.setPladdress(dataTO.getPladdress());        DataDO.setTel(dataTO.getTel());        DataDO.setUrl(dataTO.getUrl());        DataDO.setPosx(dataTO.getPosx());        DataDO.setPosy(dataTO.getPosy());        DataDO.setStoreType(dataTO.getStoreType());        return DataDO;    }

You will find that if there are many attributes, you need to write a lot of such mechanical code, and sometimes you may miss one, it will be difficult to find the problem. At this time, someone will write a main function, and Java reflection can solve this problem well. If you want to develop idea plug-in, you want to develop a plug-in that can automatically generate the o2o method body.

There are not many idea plug-in documents on the Internet, and the Chinese language is also relatively old, but the basics are also compatible. References:

Http://www.intellij.org.cn/downloads/intellij_plugin_basic.pdf

Https://docs.google.com/document/pub? Id = 13wdycwgxerisfdptoxgu1mfuc1jezpjmyccazi2cepq

Http://confluence.jetbrains.com/display/IDEADEV/PluginDevelopment
The above are all Chinese, but the version is a little old. If you can use English, you can refer to the official documents.

Http://confluence.jetbrains.com/display/IDEADEV/PluginDevelopment

However, many APIs used later must be viewed in English documents. In actual development, there are still many pitfalls. learn more from the source code of other plug-ins and explore more.

The plug-in is now available

True Generateo2o

Source code: https://github.com/ykdsg/GenerateO2O


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.