{"id":18660175,"url":"https://github.com/magiclu550/equery","last_synced_at":"2025-11-06T02:30:32.259Z","repository":{"id":102906115,"uuid":"179066905","full_name":"MagicLu550/EQuery","owner":"MagicLu550","description":"The version 032 equery with epath shell","archived":false,"fork":false,"pushed_at":"2019-05-05T07:13:48.000Z","size":1309,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-27T16:09:01.812Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MagicLu550.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-02T11:51:09.000Z","updated_at":"2019-05-05T07:13:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"3bd674a7-d57e-4125-a839-252417696557","html_url":"https://github.com/MagicLu550/EQuery","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MagicLu550%2FEQuery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MagicLu550%2FEQuery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MagicLu550%2FEQuery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MagicLu550%2FEQuery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MagicLu550","download_url":"https://codeload.github.com/MagicLu550/EQuery/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239478691,"owners_count":19645579,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T07:42:36.295Z","updated_at":"2025-11-06T02:30:32.209Z","avatar_url":"https://github.com/MagicLu550.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![996.icu](https://img.shields.io/badge/link-996.icu-red.svg)](https://996.icu)\n[![LICENSE](https://img.shields.io/badge/license-Anti%20996-blue.svg)](996.ICULICENSE)\n[![LICENSE](https://img.shields.io/badge/license-Noyark-green.svg)](LICENSE)\n![LICENSE](https://img.shields.io/badge/version-0.3.0NEW-blue.svg)\n![master](https://img.shields.io/badge/build-passing-green.svg)\n[![zh](https://img.shields.io/badge/readme-chinese-orange.svg)](chinese.md)\n![avatar](logo.jpeg)\n\n\n\n### * basic introduction\n* This `xml framework` simplifies the operation of the persistence layer configuration file and supports the object's IOC, which greatly simplifies the operation and is compatible with the usual `dom4j` operation, which allows the framework to be used in parallel with the traditional method (of course, the framework already provides The corresponding method, you must use the framework method to add elements, but these methods have a simplified operation of the framework, there are original operations. Because adding elements in the framework can register elements to the mapping factory, and is compatible with the operation of the selector) And added a selector function, a complete element selection mechanism, selector:: with 6 major features::\n`Dynamic creation (DC) ` `concurrent read and write (RW) ` `reverse control (RPC) ` `automatic assembly (AA) ` ` select conversion (SC) ` `object pool (OP) ` `search package instance ( SPI)`\n---\n\n* DC:\n Chinese (dong tai chuang jian), meaning that objects can be created dynamically and created according to various forms of configuration files, which is very flexible\n* RW:\nChinese (jian tong du xie) means that it can be compatible with the newly added elements of the document that has been written, and will not refresh the original created document.\n* RPC:\n Chinese (fan lu kong zhi), meaning the rules of the elements are created by path and reflection, thus simply adding elements\n* AA:\n Chinese (zi dong zhuang pei), meaning that the maven dependencies can be automatically assembled by loading the framework driver.\n* SC:\n Chinese (xuan ze zhuan huan), built-in converter can convert dom4j Element object into SElement recording element geometry information, and then used for selector hash query element\n* OP:\nChinese (dui xiang chi), the object pool can store the original object, the previously created object can be reused\n* SPI:\n Chinese (sou bao shi li), through the package path of the configuration file, search for the class with annotations, instantiate the object according to the annotation, and create the file at one time\n```java\n / / Development use object in EQuery:\n/**\nStarting with version 028, you must use this method to load the driver. All the driver information is in\nDriver.properties\n*/\nCore.start();\n\n/*\nIn the process of use, the file directory of the factory method of XMLDomFile can omit the .xml. The second parameter is the root element. If the same object has been created directly, and the document is read again, the parameter can be omitted, namely:\ngetXMLQuery(\"a\",false), the third is whether to enable thread safety type\nIf you don't want to create a new document and use an existing document, and you don't want to remove the original element, you can use the getDefaultXml method, then retain the original element, and you can get it. Later addition will only refresh the newly added element. Fill in the file attribute directly, of course, if there is a special path, you can add the input stream in the second parameter, the first parameter plus the path information as clear as possible, most of the special path is to read the resources folder, then the first path Can get the path with getClass\n*/\nXMLDomFile xdf = InstanceQueryer.getXMLQuery(\"a.xml\",\"root\",false);\n\nXMLDomFile xdf = InstanceQueryer.getXMLQuery(\"a\",this);\n/*\nAt the same time, the development interface of automatic assembly is opened. Its function is to use this method if your jar package is imported, and you can use this method and provide their xml configuration file. This method will automatically read and load into pom.xml.\n*/\nSetMavenJar.getInstance().setDefaultMaven(this, \"fill in the configuration file name, format and System.Maven.xml\");\n/*\nFile creation by reflection\nThere are two ways to create reflections, one class is annotated, and one class is unannotated.\nBut all need to inherit a ReadingXML class\nreadingXML has a number of constructors that correspond to the four constructors listed above (getDefaultXML, getXMLQuery...)\nUse getXMLQuery demo here\n*/\n//no annotation type\nClass Test1 extends ReadingXML{\nPublic Test1(String file,String root){\nSuper(file,root);\n}\n@path(\"a.b.c.d\")\nPublic String A = \"1\";\n}\n/*\nAfter instantiation, then call the save method\nCan create file and xml element build\n\nThere are also EQuery expressions:\n\nNote that including ':’\n\nAddnew: Same as addElements function, does not require index attribute, can be omitted\n\nAddchild: Same as addChild, you need to add the index attribute: indexs={}\n\nAddchilds: the same function as addElementsIfExistsParent, requires the indexs property\n\nAddelements: same as the function of addElements, does not require the indexs attribute\n\nCase:\n*/\n @Path(path = \"a.b.c\")\n\n Public String aString = \"1\";\n\n @Path(path=\"addchild:a.b.c\",indexs= {0,0})\n\n Public String ab = \"2\";\n\n \n\n @Path(path=\"addchilds:a.b.c/d/e\",indexs= {0,0})\n\n Public String[] abs = {\"1\",\"2\",\"3\"};\n\n \n\n @Path(path=\"addelements:a.b.c/d/e\",indexs= {0,0})\n\n Public String[] absd = {\"1\",\"2\",\"3\"};\n\n/ / Starting with version 031, support for all array types\n```\n```java\n/*\nIn addition, there is an annotation form like this\n*/\nPackage simpleXML.test;\n\n\nImport cn.gulesberry.www.reflect.ReadingXML;\nImport net.noyark.www.annocations.Path;\nImport net.noyark.www.annocations.XMLFile;\n\n@XMLFile(fileName=\"a.xml\",root=\"root\")\nPublic class Test extends ReadingXML{\n\n@Path(path = \"a.b.c\")\nPublic String aString = \"1\";\n\n@Path(path=\"addchild:a.b.c\",indexs= {0,0})\nPublic String ab = \"2\";\n\n@Path(path=\"addchilds:a.b.c/d/e\",indexs= {0,0})\nPublic String[] abs = {\"1\",\"2\",\"3\"};\n\n@Path(path=\"addelements:a.b.c/d/e\",indexs= {0,0})\nPublic String[] absd = {\"1\",\"2\",\"3\"};\n\n@Path(path=\"addelements:a.b.c/d/e\",indexs= {0,0})\nPublic String[] absd1 = {\"1\",\"2\",\"3\"};\n\n}\n```\n\u003e _ In addition to the built-in startXML configuration file, write _\n\u003e After version 030, support only writes the path of the parent package, the sub-package path is scanned by default\n```java\n\u003cxml-instance\u003e\n\u003c!-- Test-Class --\u003e\n\u003cxml-file package=\"simpleXML.test\"/\u003e\n\u003c/xml-instance\u003e\n```\nSo configured\n\u003e In addition, the auto-assembly object can be assembled like this, still in the xmlStart configuration file\n```xml\n\u003cxml-instance\u003e\n\u003c!-- Predefined objects --\u003e\n\u003cxml\u003e\n\u003cfile name=\"default\"\u003e\u003c/file\u003e\n\u003croot name=\"root\" \u003e\u003c/root\u003e\n\u003cis-sync state=\"false\"\u003e\u003c/is-sync\u003e\n\u003c/xml\u003e\n\u003c/xml-instance\u003e\n```\n\nOnly need to use after\n```java\nXMLDomFile xdf = InstanceQueryer.getXMLQuery(\"default\",this);\n```\nGet the object\n# How to select language using epath xml\n## epath is divided into 5 language structures:\n```\nStarting with version 0.0.2, spaces are replaced with with, ie:\nSelect in a with [name];\nOr select in a with name;\n```\n### 1. Wild match expression\n```\nThe wildcard expression has two keywords: the all and root keywords. Use the all keyword to get all non-root Element objects.\nThe root keyword can get the root node\nAll and root combination: all, root Get all nodes\n```\n### 2. One-dimensional expression\n```\nOne-dimensional expressions are composed of values ​​and groups, also known as single-group expressions, single-stack expressions, describing one-dimensional expressions that require a keyword to be connected.\n The basic syntax is: select in value group\n The following can also be written:\n Select in value [group]\n A single set of expressions has 13 group keywords, which are used to describe the feature information indicated by the value (or type).\n The keyword for a single set of expressions is called a single set of keywords, and most of the keywords here are only used in single-group expressions.\n Single set of expression keywords:\n One elements on under ons unders friends ids e_name text parent\n Name *path\nThe expression syntax:\nOther [selector type]\nThe selector type is an auxiliary selection type with the following auxiliary selection types.\n\nOne Select an example: a[0].b[0] [one];\nElements select multiple a[0].b[0].c [elements];\nOn selects the upper element of the element (same level) a[0].b[0].c[0] [on];\nUnder selects the following element of the element (same level a[0].b[0].c[0] [under];\nOns selects all elements above the element (same level) a[0].b[0].c[0] [ons];\nUnders selects all elements below the element (same level) a[0].b[0].c[0] [unders];\nFriends select all sibling elements a[0].b[0].c[0] [friends];\nIds selects the element IDVALUE [ids] by the ID attribute;\nE_name selects ELEMENTNAME [e_name] by the name of the element element;\nText Select ELEMENTTEXT [text];\nParent gets the parent element a[0].b[0].c[0] [parent]\nName Get the element by name name [name]\n*path gets the element by the element pointer, plus 1 to the pointer\nSee getElementByIndexPointer\nMethod a.b [*path]\nCase:\n\u003croot\u003e\n\u003ca\u003e\n\u003cb\u003e\u003c/b\u003e\n\u003cb\u003e\u003c/b\u003e\n\u003c/a\u003e\n\u003c/root\u003e\nSelect the element with the name a:\na [name]\n```\n### 3. Two-dimensional expression\n```\nThe expression syntax:\nPath/name middle [middleType];\nMiddle is an attachment selection limit, and middleType is an attachment selection restriction type.\nThere are the following subsidiary selection restriction types:\nText Select element by text and path a[0].b[0].c[0] ExampleText [text];\nNamespace selects the element by namespace a[0].b[0].c[0] prefix,uri [namespace];\nKey is selected by the attribute key and supports multiple keys a[0].b[0].c[0] key1, key2, key3 [key];\nValue is selected by the value of the attribute, supporting multiple values ​​a[0].b[0].c[0] value1, value2 [value];\nKey=value is selected by the attribute and value of the attribute, supporting multiple keys and values ​​a[0].b[0].c[0] key1=value1,key2=value2 [key=value];\nKey,only Select by the attribute of the attribute, where the role of the only keyword is to obtain the element of the element must correspond to the specified key one by one, without adding, as long as the specified is required, the syntax is the same as above\nValue,only Same as above\nText, name is selected by the name of text and element, a exmapleText [text, name];\nUri queries through the URI of the namespace a[0].b[0].c[0] prefix [prefix];\nPrefix queries through the prefix of the namespace a[0].b[0].c[0] uri [uri];\n```\n### 4. Multidimensional expression\n```\nMultidimensional expressions can query more complex conditions, where keywords can be spliced ​​at will, except\nGrammar:\n? is optional\nAll/path/name middle... [all/name/path,?only,middleType...]\nName and only keywords, regex series must be in front, and name is in front of only, regex is not limited\nKey here\ntextRegex [whether or not text is enabled for regular expressions]\nattrRegex [whether key or value is enabled, a single key=value regular expression, currently does not support multiple key=value regulars]\nAll\nPath\nName\nNamespace\nPrefix\nUri\nOnly\nKey\nValue\nBasically the same\nSelect in path with namespace with key with [path,namespace,key]\n```\n### 5.with keywords\n```\nThe with keyword has the same effect as a space, used to split the grammar, updated from epath 002, thus guaranteeing grammatical freedom\nAt the same time, the epath syntax states that spaces and with cannot coexist.\nSuch as:a[0].b[0] with [one]\n```\n### 6. Prefix words,\n```\nSelect in optional, can have braces\nSelect in {a[0].b[0] with [one]}\n```\n### 7.none keyword\n```\nSelect in{all with none with a with [all,only,attrRegex,none,key]}\nThis sentence is actually looking for a name element from the regular elements of all elements.\n```\n### 8. Pointer U-turn\n```\nSeek in path to index can implement pointer turn\nSuch as:\nSeek in a.b to 0;\n```\n### 9.epathshell\n#### EPATHSHELL stipulates that you must use with\n```\nCall Core.startEPathShell();\nYou can use the epath code in the console.\nEpath shell directive:\nSource to import epath file\nUse in replace read file\nExit(); exit the program\nPrint print object, you can directly print the function by print, or print the result of an expression and a string (enclosed by \"\" or '', does not support splicing);\nAlias\u003cname\u003e (on) select in... is an alias for the queried set of element objects, which can be used in the next statement\nSelect in alias name query element collection by alias\nPrint select in alias name\n...\nPathes get path\nIndexs get coordinates\nUse the two together to get the path and coordinates\nSuch as:print select in pathes with indexs with *;\nDefine function: func name (a,b,c){\nSelect in @a with @b with @b\n};\n?: expression, preceded by a boolean expression, followed by two code segments, when true, then executed before, when is false\nExecution behind\nAt the same time, a Boolean expression is specified here.\nSizebig sizesmall == !empty empty\nSizebig left is larger than right a sizebig b\nSizesallall left smaller than right a sizesmall b\n== Elements are exactly equal a == b\n!empty is not empty a !empty\nEmpty is empty a empty\nNesting is currently not supported\nImport function library\nSh library file path\n```\n### 10.Function object\n```\nBring your own method: excute () method,\nCan be executed immediately when the function is declared, but does not support immediate execution of complex statements.\nLogical judgment and storage variables do not support immediate execution\n```\n### 11. Native function table\n```\nCurrently the native function has\nExit function\nExcute function\n...\n```\n### 12. Operators [epath only supports native statements]\n```\nLogical operators: sizebig sizesmall == !empty empty\nFunction operator: in to\nLogical control: ?: (select in *==select in * ?print \"1\":print \"2\")\nImporter: sh (filename) source (to filename) use (in filename)\nConnector: (a) with (b)\nMulti-level separator:\nQuery character: select (in)\nOutput: print (select in .../\"\"/'')\nMemory import character: alias\u003c\u003e func (name(){};)\nMemory export character: select in alias (name), name();\n````\n### 13.Script file\n```\nThe epath script file is a .epath suffix file, which is imported by source. Note that the import only supports epath syntax.\nSelect in *;\nSelect in a with name;\nThe epath shell function script file is .func, imported via sh, note that the import supports the epath shell and epath syntax, and the code segment must be split by function.\n#epath shell equery.func\nFunc test(){\nSelect in *;\n};\nFunc test1(){\nSelect in * == select in *?print \"1\":print '2';\n};\n```\n\nThe final reminder is that you must use the maven project to import the plugin. Finally, the configuration file is in the src/main/resources/ directory. You need to copy the configuration file to your directory.\n\nHow to import the plugin?\n```xml\n\u003c!-- link jar --\u003e\n\u003cdependency\u003e\n  \u003cgroupId\u003enet.noyark\u003c/groupId\u003e\n  \u003cartifactId\u003eequery-framework\u003c/artifactId\u003e\n  \u003cversion\u003e0.3.3\u003c/version\u003e\n\u003c/dependency\u003e\n\u003c!--Link private service--\u003e\n\u003crepositories\u003e\n \u003crepository\u003e\n    \u003cid\u003enexus\u003c/id\u003e\n    \u003cname\u003eTeam Neux Repository\u003c/name\u003e\u003curl\u003ehttp://www.noyark.net:8081/nexus/content/groups/public/\u003c/url\u003e\n    \u003c/repository\u003e\n\u003c/repositories\u003e\n\u003cpluginRepositories\u003e\n    \u003cpluginRepository\u003e\n      \u003cid\u003enexus\u003c/id\u003e\n      \u003cname\u003eTeam Neux Repository\u003c/name\u003e\n      \u003curl\u003ehttp://www.noyark.net:8081/nexus/content/groups/public/\u003c/url\u003e\n    \u003c/pluginRepository\u003e\n \u003c/pluginRepositories\u003e\n\n```\n\nweb: [web]\n\ndoc: [doc]\n\nmaven: [maven]\n\n[web]: http://magic.noyark.net\n\n[doc]: http://sxml.noyark.net\n\n[maven]: http://www.noyark.net:8081/nexus\n\n[chinese.md]: chinese.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagiclu550%2Fequery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagiclu550%2Fequery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagiclu550%2Fequery/lists"}