# groovyScript **Repository Path**: null_313_7721/groovyScript ## Basic Information - **Project Name**: groovyScript - **Description**: 收集的一些groovy script - **Primary Language**: Groovy - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2016-12-14 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README #groovyScript ##网络 正如Groovy对Java进行了包装优化一样,基于Groovy的HttpBuilder也包裹了HttpClient,使网络编程变得更加的方便易用 [github上项目的源码和使用方法](https://github.com/jgritman/httpbuilder/wiki) ##script在终端中输出改变颜色 ``` RESET = "\u001B[0m"; BLACK = "\u001B[30m"; RED = "\u001B[31m"; GREEN = "\u001B[32m"; YELLOW = "\u001B[33m"; BLUE = "\u001B[34m"; PURPLE = "\u001B[35m"; CYAN = "\u001B[36m"; WHITE = "\u001B[37m"; ``` ` println("\u001B[31m This text is red! \u001B[0m") ` ## 创建javabean, 新建对象 grovy 中,只需要在对象中声明属性,其构造函数会自动生成: ``` public class Person { def name def age def gender } ``` 这时只需要 `def person = new Person(name : "jack", age : 18, gender: "male")`,就可以新建出一个对象。