Title: Item JSON parse · Issue #1 · InfinityStudio/SimpleAPI · GitHub
Open Graph Title: Item JSON parse · Issue #1 · InfinityStudio/SimpleAPI
X Title: Item JSON parse · Issue #1 · InfinityStudio/SimpleAPI
Description: Parse Item JSON format and produce a Item object Item JSON ===some parsing process===> Item Object JSON format is defined in: https://infinitystudio.github.io/SimpleAPI/docs/Item.html Parsing process context: (the thing this module doesn...
Open Graph Description: Parse Item JSON format and produce a Item object Item JSON ===some parsing process===> Item Object JSON format is defined in: https://infinitystudio.github.io/SimpleAPI/docs/Item.html Parsing proce...
X Description: Parse Item JSON format and produce a Item object Item JSON ===some parsing process===> Item Object JSON format is defined in: https://infinitystudio.github.io/SimpleAPI/docs/Item.html Parsing pr...
Opengraph URL: https://github.com/InfinityStudio/SimpleAPI/issues/1
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Item JSON parse","articleBody":"Parse Item JSON format and produce a Item object\r\n\r\nItem JSON ===some parsing process===\u003e Item Object\r\n\r\nJSON format is defined in:\r\nhttps://infinitystudio.github.io/SimpleAPI/docs/Item.html\r\n\r\nParsing process context: (the thing this module doesn't need to care about)\r\n**modid**, the modid of the Mod that own this item\r\n**ItemTypeHandlerRegistry**, the registry of the ItemTypeHandler, which is used to decorate Item with special property\r\n**CapabilityInjector**, the api that injects the capability to a thing\r\n\r\n~~ItemTypeHandlerRegistry和CapabilityInjector我都没写……没实现也没interface……LG你就定义2个顺手的interface把……modid和这俩你就当方法参数传进来就好了~~\r\n\r\nParsing process overview:\r\n1. determine the **type** of the item\r\n2. new DelegatedItem()\r\n3. set forge registry resLocation and unlocalized name (basically, you combine the modid and id property in JSON and generate resLocation and unlocalized name)\r\n4. inject capability if it requires\r\n5. get the **ItemTypeHandler** and feed the JSON (or maybe you store other property in a new map) to this handler. So the Item is decorated with special properties\r\n\r\nsample interfaces:\r\n```\r\ninterface ItemTypeHandler {\r\n void decorate(ItemDelegate item, JsonOrMap data);\r\n}\r\ninterface ItemTypeHandlerRegistry {\r\n ItemTypeHandler getHandler(String type)\r\n}\r\ninterface CapabilityInjector{\r\n void inject(Object obj, CapabilityInfo info);\r\n}\r\n```\r\n~~(当然如果那些没实现的你想实现也没问题23333)~~","author":{"url":"https://github.com/ci010","@type":"Person","name":"ci010"},"datePublished":"2017-09-07T13:53:03.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/1/SimpleAPI/issues/1"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:02161356-8f9a-7bf5-aeb2-e56dbe68555a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9416:E674:1D7712D:2936BDD:697BA6F9 |
| html-safe-nonce | 6b411755928b9a1d9517ffd62159a9be2817b73c03b375e53dbbc22dd1e3e07c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NDE2OkU2NzQ6MUQ3NzEyRDoyOTM2QkREOjY5N0JBNkY5IiwidmlzaXRvcl9pZCI6IjI4ODg2ODM4Mzg0MjA3ODg5ODUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 44357057591cf341f3e4f8207f6b198390a052db47a6e1d7cbf512f148b5df1a |
| hovercard-subject-tag | issue:255944655 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/InfinityStudio/SimpleAPI/1/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ff71e1ae67fa875ba5d4cdec89c4c7b96ba502676be72e36344d1636d733c1ae/InfinityStudio/SimpleAPI/issues/1 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ff71e1ae67fa875ba5d4cdec89c4c7b96ba502676be72e36344d1636d733c1ae/InfinityStudio/SimpleAPI/issues/1 |
| og:image:alt | Parse Item JSON format and produce a Item object Item JSON ===some parsing process===> Item Object JSON format is defined in: https://infinitystudio.github.io/SimpleAPI/docs/Item.html Parsing proce... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ci010 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7ba9ae7380317898f1b98f4cf41e78605ff2d68007cb4db4e46bdaf7e9423d2e |
| turbo-cache-control | no-preview |
| go-import | github.com/InfinityStudio/SimpleAPI git https://github.com/InfinityStudio/SimpleAPI.git |
| octolytics-dimension-user_id | 7335414 |
| octolytics-dimension-user_login | InfinityStudio |
| octolytics-dimension-repository_id | 88496949 |
| octolytics-dimension-repository_nwo | InfinityStudio/SimpleAPI |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 88496949 |
| octolytics-dimension-repository_network_root_nwo | InfinityStudio/SimpleAPI |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d52dd9b71f0e5da9cfd694fb2faae78a81d8e46f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width