{
    "content": [
        {
            "type": "text",
            "text": "# Net::XMPP::JID (perldoc)\n\n## NAME\n\nNet::XMPP::JID - XMPP JID Module\n\n## SYNOPSIS\n\nNet::XMPP::JID is a companion to the Net::XMPP module. It provides the user a simple interface\nto set and retrieve all parts of a Jabber ID (userid on a server).\n\n## DESCRIPTION\n\nTo initialize the JID you must pass it the string that represents the jid from the XML packet.\nInside the XMPP modules this is done automatically and the JID object is returned instead of a\nstring. For example, in the callback function for the XMPP object foo:\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (2 subsections)\n- **METHODS** (2 subsections)\n- **AUTHOR**\n- **COPYRIGHT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Net::XMPP::JID",
        "section": "",
        "mode": "perldoc",
        "summary": "Net::XMPP::JID - XMPP JID Module",
        "synopsis": "Net::XMPP::JID is a companion to the Net::XMPP module. It provides the user a simple interface\nto set and retrieve all parts of a Jabber ID (userid on a server).",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 25,
                "subsections": [
                    {
                        "name": "Retrieval functions",
                        "lines": 8
                    },
                    {
                        "name": "Creation functions",
                        "lines": 10
                    }
                ]
            },
            {
                "name": "METHODS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "Retrieval functions",
                        "lines": 27
                    },
                    {
                        "name": "Creation functions",
                        "lines": 30
                    }
                ]
            },
            {
                "name": "AUTHOR",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 2,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Net::XMPP::JID - XMPP JID Module\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "Net::XMPP::JID is a companion to the Net::XMPP module. It provides the user a simple interface\nto set and retrieve all parts of a Jabber ID (userid on a server).\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "To initialize the JID you must pass it the string that represents the jid from the XML packet.\nInside the XMPP modules this is done automatically and the JID object is returned instead of a\nstring. For example, in the callback function for the XMPP object foo:\n\nuse Net::XMPP;\n\nsub foo {\nmy $foo = Net::XMPP::Foo->new(@);\nmy $from = $foo->GetFrom();\nmy $JID = Net::XMPP::JID->new($from);\n.\n.\n.\n}\n\nYou now have access to all of the retrieval functions available.\n\nTo create a new JID to send to the server:\n\nuse Net::XMPP;\n\n$JID = Net::XMPP::JID->new();\n\nNow you can call the creation functions below to populate the tag before sending it.\n",
                "subsections": [
                    {
                        "name": "Retrieval functions",
                        "content": "$userid   = $JID->GetUserID();\n$server   = $JID->GetServer();\n$resource = $JID->GetResource();\n\n$JID      = $JID->GetJID();\n$fullJID  = $JID->GetJID(\"full\");\n$baseJID  = $JID->GetJID(\"base\");\n"
                    },
                    {
                        "name": "Creation functions",
                        "content": "$JID->SetJID(userid=>\"bob\",\nserver=>\"jabber.org\",\nresource=>\"Work\");\n\n$JID->SetJID('blue@moon.org/Home');\n\n$JID->SetUserID(\"foo\");\n$JID->SetServer(\"bar.net\");\n$JID->SetResource(\"Foo Bar\");\n"
                    }
                ]
            },
            "METHODS": {
                "content": "",
                "subsections": [
                    {
                        "name": "Retrieval functions",
                        "content": "GetUserID\nGetUserID()\n\nreturns a string with the userid of the JID. If the string is an address (bob%jabber.org)\nthen the function will return it as an address (bob@jabber.org).\n\nGetServer\nGetServer()\n\nreturns a string with the server of the JID.\n\nGerResource\nGetResource()\n\nreturns a string with the resource of the JID.\n\nGetJID\nGetJID()\nGetJID(\"full\")\nGetJID(\"base\")\nreturns a string that represents the JID stored\nwithin.  If the \"full\" string is specified, then\nyou get the full JID, including Resource, which\nshould be used to send to the server.  If the \"base\",\nstring is specified, then you will just get\nuser@server, or the base JID.\n"
                    },
                    {
                        "name": "Creation functions",
                        "content": "SetJID\nSetJID(userid=>string,\nserver=>string,\nresource=>string)\nSetJID(string)\n\nset multiple fields in the jid at one time. This is a cumulative and over writing action. If\nyou set the \"userid\" attribute twice, the second setting is what is used. If you set the\nserver, and then set the resource then both will be in the jid. If all you pass is a string,\nthen that string is used as the JID. For valid settings read the specific Set functions\nbelow.\n\nSetUserID\nSetUserID(string)\n\nsets the userid. Must be a valid userid or the server will complain if you try to use this\nJID to talk to the server. If the string is an address then it will be converted to the %\nform suitable for using as a User ID.\n\nSerServer\nSetServer(string)\n\nsets the server. Must be a valid host on the network or the server will not be able to talk\nto it.\n\nSetResource\nSetResource(string)\n\nsets the resource of the userid to talk to.\n"
                    }
                ]
            },
            "AUTHOR": {
                "content": "Originally authored by Ryan Eatmon.\n\nPreviously maintained by Eric Hacker.\n\nCurrently maintained by Darian Anthony Patrick.\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "This module is free software, you can redistribute it and/or modify it under the LGPL 2.1.\n",
                "subsections": []
            }
        }
    }
}