Updated ana to support basic proxy authentication on the client side.
This commit is contained in:
parent
0da3dde7fa
commit
f389d3df07
34 changed files with 3980 additions and 4504 deletions
928
src/ana/Doxyfile
928
src/ana/Doxyfile
File diff suppressed because it is too large
Load diff
|
@ -1,9 +1,10 @@
|
|||
/* $Id$ */
|
||||
|
||||
/**
|
||||
* @file ana.hpp
|
||||
* @brief Main include file for application developers that wish to use ana.
|
||||
*
|
||||
* ana: Asynchronous Network API.
|
||||
* <http://async-net-api.googlecode.com/>
|
||||
* Copyright (C) 2010 Guillermo Biset.
|
||||
*
|
||||
* This file is part of the ana project.
|
||||
|
@ -11,11 +12,10 @@
|
|||
* Contents: Main header file for ana providing the whole public API.
|
||||
*
|
||||
* System: ana
|
||||
* Homepage: <http://async-net-api.googlecode.com/>
|
||||
* Language: C++
|
||||
*
|
||||
* Author: Guillermo Biset
|
||||
* E-Mail: billybiset AT gmail.com
|
||||
* E-Mail: billybiset AT gmail DOT com
|
||||
*
|
||||
* ana is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
|
@ -1,3 +1,35 @@
|
|||
/* $Id$ */
|
||||
|
||||
/**
|
||||
* @file asio_client.cpp
|
||||
* @brief Implementation of the client side of the ana project.
|
||||
*
|
||||
* ana: Asynchronous Network API.
|
||||
* Copyright (C) 2010 Guillermo Biset.
|
||||
*
|
||||
* This file is part of the ana project.
|
||||
*
|
||||
* System: ana
|
||||
* Language: C++
|
||||
*
|
||||
* Author: Guillermo Biset
|
||||
* E-Mail: billybiset AT gmail DOT com
|
||||
*
|
||||
* ana is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ana is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with ana. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <memory>
|
||||
|
@ -24,7 +56,6 @@ asio_client::asio_client(ana::address address, ana::port pt) :
|
|||
|
||||
asio_client::~asio_client()
|
||||
{
|
||||
delete proxy_;
|
||||
}
|
||||
|
||||
ana::client* ana::client::create(ana::address address, ana::port pt)
|
||||
|
@ -45,9 +76,14 @@ ana::client_id asio_client::id() const
|
|||
return 0;
|
||||
}
|
||||
|
||||
void asio_client::handle_proxy_connection()
|
||||
void asio_client::handle_proxy_connection(const boost::system::error_code& ec, ana::connection_handler* handler)
|
||||
{
|
||||
run_listener();
|
||||
handler->handle_connect( ec, 0 );
|
||||
|
||||
if ( ! ec )
|
||||
run_listener();
|
||||
|
||||
delete proxy_;
|
||||
}
|
||||
|
||||
void asio_client::handle_connect(const boost::system::error_code& ec,
|
||||
|
@ -112,9 +148,9 @@ void asio_client::connect_through_proxy(ana::proxy::authentication_type auth_typ
|
|||
proxy_info.user_name = user_name;
|
||||
proxy_info.password = password;
|
||||
|
||||
proxy_ = new proxy_connection( socket_, proxy_info, address_, port_, this);
|
||||
proxy_ = new proxy_connection( socket_, proxy_info, address_, port_);
|
||||
|
||||
proxy_->connect( handler );
|
||||
proxy_->connect( this, handler );
|
||||
}
|
||||
|
||||
void asio_client::send(boost::asio::const_buffer buffer, ana::send_handler* handler, ana::send_type copy_buffer )
|
||||
|
|
|
@ -1,3 +1,35 @@
|
|||
/* $Id$ */
|
||||
|
||||
/**
|
||||
* @file asio_client.hpp
|
||||
* @brief Header file of the client side of the ana project.
|
||||
*
|
||||
* ana: Asynchronous Network API.
|
||||
* Copyright (C) 2010 Guillermo Biset.
|
||||
*
|
||||
* This file is part of the ana project.
|
||||
*
|
||||
* System: ana
|
||||
* Language: C++
|
||||
*
|
||||
* Author: Guillermo Biset
|
||||
* E-Mail: billybiset AT gmail DOT com
|
||||
*
|
||||
* ana is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ana is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with ana. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <boost/asio.hpp>
|
||||
#include <memory>
|
||||
|
||||
|
@ -45,7 +77,7 @@ class asio_client : public ana::client,
|
|||
|
||||
virtual void disconnect_listener();
|
||||
|
||||
virtual void handle_proxy_connection();
|
||||
virtual void handle_proxy_connection(const boost::system::error_code&, ana::connection_handler*);
|
||||
|
||||
void handle_sent_header(const boost::system::error_code& ec,
|
||||
mili::bostream*, ana::detail::shared_buffer,
|
||||
|
|
|
@ -1,3 +1,35 @@
|
|||
/* $Id$ */
|
||||
|
||||
/**
|
||||
* @file asio_listener.cpp
|
||||
* @brief Implementation of a listener for the ana project.
|
||||
*
|
||||
* ana: Asynchronous Network API.
|
||||
* Copyright (C) 2010 Guillermo Biset.
|
||||
*
|
||||
* This file is part of the ana project.
|
||||
*
|
||||
* System: ana
|
||||
* Language: C++
|
||||
*
|
||||
* Author: Guillermo Biset
|
||||
* E-Mail: billybiset AT gmail DOT com
|
||||
*
|
||||
* ana is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ana is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with ana. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/thread.hpp>
|
||||
|
||||
|
@ -91,10 +123,8 @@ void asio_listener::listen_one_message()
|
|||
try
|
||||
{
|
||||
boost::asio::async_read(socket_, boost::asio::buffer(header_, ana::HeaderLength),
|
||||
boost::bind(&asio_listener::handle_header,
|
||||
this, header_,
|
||||
boost::asio::placeholders::error,
|
||||
listener_));
|
||||
boost::bind(&asio_listener::handle_header, this,
|
||||
header_, boost::asio::placeholders::error, listener_));
|
||||
}
|
||||
catch(const std::exception& e)
|
||||
{
|
||||
|
|
|
@ -1,3 +1,35 @@
|
|||
/* $Id$ */
|
||||
|
||||
/**
|
||||
* @file asio_listener.hpp
|
||||
* @brief Header file of a listener for the ana project.
|
||||
*
|
||||
* ana: Asynchronous Network API.
|
||||
* Copyright (C) 2010 Guillermo Biset.
|
||||
*
|
||||
* This file is part of the ana project.
|
||||
*
|
||||
* System: ana
|
||||
* Language: C++
|
||||
*
|
||||
* Author: Guillermo Biset
|
||||
* E-Mail: billybiset AT gmail DOT com
|
||||
*
|
||||
* ana is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ana is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with ana. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef ASIO_LISTENER_HPP
|
||||
#define ASIO_LISTENER_HPP
|
||||
|
||||
|
|
|
@ -1,14 +1,46 @@
|
|||
/* $Id$ */
|
||||
|
||||
/**
|
||||
* @file asio_proxy_connection.cpp
|
||||
* @brief Implementation of the client side proxy connection for the ana project.
|
||||
*
|
||||
* ana: Asynchronous Network API.
|
||||
* Copyright (C) 2010 Guillermo Biset.
|
||||
*
|
||||
* This file is part of the ana project.
|
||||
*
|
||||
* System: ana
|
||||
* Language: C++
|
||||
*
|
||||
* Author: Guillermo Biset
|
||||
* E-Mail: billybiset AT gmail DOT com
|
||||
*
|
||||
* ana is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ana is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with ana. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sstream>
|
||||
|
||||
#include "asio_proxy_connection.hpp"
|
||||
|
||||
proxy_connection::proxy_connection(tcp::socket& socket, proxy_information pi, ana::address address,
|
||||
ana::port port, proxy_connection_manager* manager) :
|
||||
proxy_connection::proxy_connection(tcp::socket& socket, proxy_information pi, ana::address address, ana::port port) :
|
||||
socket_(socket),
|
||||
proxy_info_(pi),
|
||||
address_(address),
|
||||
port_(port),
|
||||
manager_(manager)
|
||||
manager_( NULL ),
|
||||
conn_handler_( NULL )
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -23,61 +55,143 @@ std::string* proxy_connection::generate_connect_request() const
|
|||
);
|
||||
}
|
||||
|
||||
void proxy_connection::handle_response(boost::asio::streambuf* buf,
|
||||
const boost::system::error_code& ec,
|
||||
ana::connection_handler* handler)
|
||||
std::string* proxy_connection::generate_base64_credentials() const
|
||||
{
|
||||
//TODO: interpret the response and act accordingly
|
||||
if ( ec )
|
||||
handler->handle_connect(ec, 0);
|
||||
else
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << buf;
|
||||
const std::string user_and_pass( proxy_info_.user_name + ':' + proxy_info_.password );
|
||||
return new std::string
|
||||
(
|
||||
"CONNECT " + address_ + ":" + port_ + " HTTP/1.0\n"
|
||||
"User-agent: ana 0.1 \n"
|
||||
"Proxy-Connection: keep-alive\n"
|
||||
"Proxy-Authorization: Basic " + base64_encode(user_and_pass.c_str(), user_and_pass.size() ) + "\n"
|
||||
"\n"
|
||||
);
|
||||
}
|
||||
|
||||
const size_t find_pos = ss.str().find( std::string( "200 Connection established" ) );
|
||||
std::string proxy_connection::base64_encode(char const* bytes_to_encode, unsigned int in_len) const
|
||||
{
|
||||
std::string ret;
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
unsigned char char_array_3[3];
|
||||
unsigned char char_array_4[4];
|
||||
const char base64_chars[(1 << 6) + 2] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
||||
|
||||
if ( find_pos < ss.str().size() )
|
||||
{
|
||||
handler->handle_connect( ec, 0 );
|
||||
manager_->handle_proxy_connection();
|
||||
while (in_len--) {
|
||||
char_array_3[i++] = *(bytes_to_encode++);
|
||||
if (i == 3) {
|
||||
char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;
|
||||
char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4);
|
||||
char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6);
|
||||
char_array_4[3] = char_array_3[2] & 0x3f;
|
||||
|
||||
for(i = 0; (i <4) ; i++)
|
||||
ret += base64_chars[char_array_4[i]];
|
||||
i = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (i)
|
||||
{
|
||||
for(j = i; j < 3; j++)
|
||||
char_array_3[j] = '\0';
|
||||
|
||||
char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;
|
||||
char_array_4[1] = ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4);
|
||||
char_array_4[2] = ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6);
|
||||
char_array_4[3] = char_array_3[2] & 0x3f;
|
||||
|
||||
for (j = 0; (j < i + 1); j++)
|
||||
ret += base64_chars[char_array_4[j]];
|
||||
|
||||
while((i++ < 3))
|
||||
ret += '=';
|
||||
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool proxy_connection::finds( const std::string& source, char const* pattern )
|
||||
{
|
||||
const size_t find_pos = source.find( std::string( pattern ) );
|
||||
|
||||
return find_pos < source.size();
|
||||
}
|
||||
|
||||
void proxy_connection::handle_response(boost::asio::streambuf* buf,
|
||||
const boost::system::error_code& ec,
|
||||
size_t bytes_read)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << buf;
|
||||
delete buf;
|
||||
|
||||
if ( ec )
|
||||
manager_->handle_proxy_connection( ec, conn_handler_ );
|
||||
else
|
||||
{
|
||||
if ( finds( ss.str(), "200 Connection established" ) )
|
||||
manager_->handle_proxy_connection( ec, conn_handler_ );
|
||||
else
|
||||
{
|
||||
if ( ( ! authenticating_ ) && finds( ss.str(), "407 Proxy Authentication Required" ) )
|
||||
{
|
||||
if ( finds( ss.str(), "Proxy-Authenticate: Basic" ) )
|
||||
{
|
||||
authenticating_ = true;
|
||||
socket_.close();
|
||||
|
||||
do_connect( );
|
||||
}
|
||||
else //TODO: digest authentication support here
|
||||
manager_->handle_proxy_connection(
|
||||
boost::system::error_code(1,boost::system::get_generic_category() ),
|
||||
conn_handler_);
|
||||
|
||||
}
|
||||
else //Couldn't connect, wrong password or wasn't offered the possibility to authenticate
|
||||
manager_->handle_proxy_connection(
|
||||
boost::system::error_code(1,boost::system::get_generic_category() ),
|
||||
conn_handler_);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void proxy_connection::handle_sent_request(const boost::system::error_code& ec,
|
||||
std::string* request,
|
||||
ana::connection_handler* handler)
|
||||
std::string* request)
|
||||
{
|
||||
delete request;
|
||||
|
||||
boost::asio::streambuf* buf = new boost::asio::streambuf( 500 );
|
||||
boost::asio::streambuf* buf = new boost::asio::streambuf( );
|
||||
|
||||
boost::asio::async_read_until(socket_, *buf,
|
||||
"\r\n\r\n",
|
||||
boost::bind(&proxy_connection::handle_response, this,
|
||||
buf, boost::asio::placeholders::error, handler));
|
||||
|
||||
buf, boost::asio::placeholders::error,_2));
|
||||
}
|
||||
|
||||
void proxy_connection::handle_connect(const boost::system::error_code& ec,
|
||||
tcp::resolver::iterator endpoint_iterator,
|
||||
ana::connection_handler* handler)
|
||||
tcp::resolver::iterator endpoint_iterator)
|
||||
{
|
||||
if ( ! ec )
|
||||
{
|
||||
std::string* request( generate_connect_request() );
|
||||
std::string* request( NULL );
|
||||
|
||||
if ( authenticating_ )
|
||||
request = generate_base64_credentials();
|
||||
else
|
||||
request = generate_connect_request();
|
||||
|
||||
socket_.async_send(boost::asio::buffer( *request ),
|
||||
boost::bind(&proxy_connection::handle_sent_request,this,
|
||||
boost::asio::placeholders::error,
|
||||
request, handler));
|
||||
request));
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( endpoint_iterator == tcp::resolver::iterator() ) // could not connect to proxy
|
||||
handler->handle_connect( ec, 0 );
|
||||
manager_->handle_proxy_connection( ec, conn_handler_ );
|
||||
else
|
||||
{
|
||||
//retry
|
||||
|
@ -86,12 +200,12 @@ void proxy_connection::handle_connect(const boost::system::error_code& ec,
|
|||
tcp::endpoint endpoint = *endpoint_iterator;
|
||||
socket_.async_connect(endpoint,
|
||||
boost::bind(&proxy_connection::handle_connect, this,
|
||||
boost::asio::placeholders::error, ++endpoint_iterator, handler));
|
||||
boost::asio::placeholders::error, ++endpoint_iterator));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void proxy_connection::connect( ana::connection_handler* handler )
|
||||
void proxy_connection::do_connect()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -100,13 +214,24 @@ void proxy_connection::connect( ana::connection_handler* handler )
|
|||
tcp::resolver::iterator endpoint_iterator = resolver.resolve(query);
|
||||
|
||||
tcp::endpoint endpoint = *endpoint_iterator;
|
||||
|
||||
socket_.async_connect(endpoint,
|
||||
boost::bind(&proxy_connection::handle_connect, this,
|
||||
boost::asio::placeholders::error, ++endpoint_iterator, handler));
|
||||
boost::asio::placeholders::error, ++endpoint_iterator));
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
handler->handle_connect( boost::system::error_code(1,boost::system::get_generic_category() ), 0 );
|
||||
std::cerr << "Client: An error ocurred, " << e.what() << std::endl;
|
||||
manager_->handle_proxy_connection(
|
||||
boost::system::error_code(1,boost::system::get_generic_category() ),
|
||||
conn_handler_ );
|
||||
}
|
||||
}
|
||||
|
||||
void proxy_connection::connect( proxy_connection_manager* manager, ana::connection_handler* handler )
|
||||
{
|
||||
manager_ = manager;
|
||||
conn_handler_ = handler;
|
||||
authenticating_ = false;
|
||||
|
||||
do_connect();
|
||||
}
|
||||
|
|
|
@ -1,3 +1,35 @@
|
|||
/* $Id$ */
|
||||
|
||||
/**
|
||||
* @file asio_proxy_connection.hpp
|
||||
* @brief Header file of the client side proxy connection for the ana project.
|
||||
*
|
||||
* ana: Asynchronous Network API.
|
||||
* Copyright (C) 2010 Guillermo Biset.
|
||||
*
|
||||
* This file is part of the ana project.
|
||||
*
|
||||
* System: ana
|
||||
* Language: C++
|
||||
*
|
||||
* Author: Guillermo Biset
|
||||
* E-Mail: billybiset AT gmail DOT com
|
||||
*
|
||||
* ana is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ana is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with ana. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <boost/asio.hpp>
|
||||
|
@ -11,7 +43,7 @@ using boost::asio::ip::tcp;
|
|||
|
||||
struct proxy_connection_manager
|
||||
{
|
||||
virtual void handle_proxy_connection() = 0;
|
||||
virtual void handle_proxy_connection(const boost::system::error_code&, ana::connection_handler* ) = 0;
|
||||
};
|
||||
|
||||
struct proxy_information
|
||||
|
@ -35,37 +67,41 @@ struct proxy_information
|
|||
class proxy_connection
|
||||
{
|
||||
public:
|
||||
proxy_connection(tcp::socket& socket,
|
||||
proxy_connection(tcp::socket& socket,
|
||||
proxy_information pi,
|
||||
ana::address address,
|
||||
ana::port port,
|
||||
proxy_connection_manager* manager);
|
||||
ana::address address,
|
||||
ana::port port);
|
||||
|
||||
void connect( ana::connection_handler* handler );
|
||||
void connect( proxy_connection_manager* manager, ana::connection_handler* handler );
|
||||
|
||||
private:
|
||||
std::string* generate_connect_request() const;
|
||||
std::string* generate_connect_request() const;
|
||||
std::string* generate_base64_credentials() const;
|
||||
|
||||
void handle_connect(const boost::system::error_code& ec,
|
||||
tcp::resolver::iterator endpoint_iterator,
|
||||
ana::connection_handler* handler);
|
||||
void do_connect( );
|
||||
|
||||
void handle_sent_request(const boost::system::error_code& ec,
|
||||
std::string* request, ana::connection_handler* handler);
|
||||
void handle_connect(const boost::system::error_code& ec, tcp::resolver::iterator endpoint_iterator);
|
||||
|
||||
void handle_response( boost::asio::streambuf* buf ,
|
||||
const boost::system::error_code& ,
|
||||
ana::connection_handler* );
|
||||
void handle_sent_request(const boost::system::error_code& ec, std::string* request);
|
||||
|
||||
void handle_response( boost::asio::streambuf* buf , const boost::system::error_code&, size_t );
|
||||
|
||||
bool finds( const std::string& source, char const* pattern );
|
||||
|
||||
std::string base64_encode(char const* bytes_to_encode, unsigned int in_len) const;
|
||||
|
||||
// Attributes
|
||||
tcp::socket& socket_;
|
||||
tcp::socket& socket_;
|
||||
|
||||
const proxy_information proxy_info_;
|
||||
const proxy_information proxy_info_;
|
||||
|
||||
ana::address address_;
|
||||
ana::port port_;
|
||||
ana::address address_;
|
||||
ana::port port_;
|
||||
|
||||
proxy_connection_manager* manager_;
|
||||
ana::connection_handler* conn_handler_;
|
||||
|
||||
bool authenticating_;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,33 +0,0 @@
|
|||
#ifndef ASIO_SENDER_HPP
|
||||
#define ASIO_SENDER_HPP
|
||||
|
||||
#include <boost/asio.hpp>
|
||||
#include <memory>
|
||||
|
||||
#include "ana.hpp"
|
||||
|
||||
using boost::asio::ip::tcp;
|
||||
|
||||
class asio_listener : public virtual ana::listener
|
||||
{
|
||||
public:
|
||||
asio_listener( tcp::socket& );
|
||||
|
||||
private:
|
||||
virtual void disconnect_listener() {}
|
||||
|
||||
void listen_one_message();
|
||||
|
||||
void disconnect( ana::listener_handler* listener, boost::system::error_code error);
|
||||
|
||||
void handle_header(char* header, const boost::system::error_code& , ana::listener_handler* );
|
||||
|
||||
void handle_body(char* body, size_t , const boost::system::error_code& , ana::listener_handler* );
|
||||
|
||||
/*attr*/
|
||||
boost::asio::io_service& io_service_;
|
||||
tcp::socket& socket_;
|
||||
ana::listener_handler* listener_;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,3 +1,35 @@
|
|||
/* $Id$ */
|
||||
|
||||
/**
|
||||
* @file asio_server.cpp
|
||||
* @brief Implementation of the server side for the ana project.
|
||||
*
|
||||
* ana: Asynchronous Network API.
|
||||
* Copyright (C) 2010 Guillermo Biset.
|
||||
*
|
||||
* This file is part of the ana project.
|
||||
*
|
||||
* System: ana
|
||||
* Language: C++
|
||||
*
|
||||
* Author: Guillermo Biset
|
||||
* E-Mail: billybiset AT gmail DOT com
|
||||
*
|
||||
* ana is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ana is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with ana. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <boost/thread.hpp>
|
||||
#include <boost/bind.hpp>
|
||||
|
||||
|
|
|
@ -1,15 +1,32 @@
|
|||
/* $Id$ */
|
||||
|
||||
/**
|
||||
* \file asio_server.hpp
|
||||
* \brief Definition of asio_server class.
|
||||
* @file asio_server.hpp
|
||||
* @brief Header file of the server side for the ana project.
|
||||
*
|
||||
* Copyright (C) 2010 Guillermo Biset
|
||||
* ana: Asynchronous Network API.
|
||||
* Copyright (C) 2010 Guillermo Biset.
|
||||
*
|
||||
* Contents: Header file providing class asio_server.
|
||||
* This file is part of the ana project.
|
||||
*
|
||||
* System: ana
|
||||
* Language: C++
|
||||
*
|
||||
* Author: Guillermo Biset
|
||||
* E-Mail: billybiset AT gmail.com
|
||||
* E-Mail: billybiset AT gmail DOT com
|
||||
*
|
||||
* ana is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ana is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with ana. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
|
|
|
@ -1,3 +1,35 @@
|
|||
/* $Id$ */
|
||||
|
||||
/**
|
||||
* @file client.cpp
|
||||
* @brief Client side chat application. Example for the ana project.
|
||||
*
|
||||
* ana: Asynchronous Network API.
|
||||
* Copyright (C) 2010 Guillermo Biset.
|
||||
*
|
||||
* This file is part of the ana project.
|
||||
*
|
||||
* System: ana
|
||||
* Language: C++
|
||||
*
|
||||
* Author: Guillermo Biset
|
||||
* E-Mail: billybiset AT gmail DOT com
|
||||
*
|
||||
* ana is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ana is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with ana. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "getopt_pp.h"
|
||||
|
@ -126,7 +158,9 @@ class ChatClient : public ana::listener_handler,
|
|||
client_->connect_through_proxy(conn_info_.get_ana_auth_type(),
|
||||
conn_info_.proxyaddr,
|
||||
conn_info_.proxyport,
|
||||
this);
|
||||
this,
|
||||
conn_info_.user,
|
||||
conn_info_.password);
|
||||
|
||||
client_->set_listener_handler( this );
|
||||
client_->run();
|
||||
|
@ -152,12 +186,12 @@ class ChatClient : public ana::listener_handler,
|
|||
virtual void handle_connect( ana::error_code error, client_id server_id )
|
||||
{
|
||||
if ( error )
|
||||
std::cerr << "Error connecting." << std::endl;
|
||||
else
|
||||
{
|
||||
std::cout << "\nConnected.\n";
|
||||
client_->send( ana::buffer( std::string("/name ") + name_) , this);
|
||||
std::cerr << "\nError connecting." << std::endl;
|
||||
continue_ = false;
|
||||
}
|
||||
else
|
||||
client_->send( ana::buffer( std::string("/name ") + name_) , this);
|
||||
}
|
||||
|
||||
virtual void handle_disconnect( ana::error_code error, client_id server_id)
|
||||
|
|
|
@ -1,3 +1,35 @@
|
|||
/* $Id$ */
|
||||
|
||||
/**
|
||||
* @file detail.hpp
|
||||
* @brief Implementation details for the ana project. Private file, do not include directly.
|
||||
*
|
||||
* ana: Asynchronous Network API.
|
||||
* Copyright (C) 2010 Guillermo Biset.
|
||||
*
|
||||
* This file is part of the ana project.
|
||||
*
|
||||
* System: ana
|
||||
* Language: C++
|
||||
*
|
||||
* Author: Guillermo Biset
|
||||
* E-Mail: billybiset AT gmail DOT com
|
||||
*
|
||||
* ana is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ana is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with ana. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef DETAIL_INTERNAL_HPP
|
||||
#error "Private file, do not include directly."
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,34 @@
|
|||
/* $Id$ */
|
||||
|
||||
/**
|
||||
* @file server.hpp
|
||||
* @brief Server side chat application. Example for the ana project.
|
||||
*
|
||||
* ana: Asynchronous Network API.
|
||||
* Copyright (C) 2010 Guillermo Biset.
|
||||
*
|
||||
* This file is part of the ana project.
|
||||
*
|
||||
* System: ana
|
||||
* Language: C++
|
||||
*
|
||||
* Author: Guillermo Biset
|
||||
* E-Mail: billybiset AT gmail DOT com
|
||||
*
|
||||
* ana is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* ana is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with ana. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
|
||||
*/
|
||||
package org.wesnoth.wml;
|
||||
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Campaign Type</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
*
|
||||
* @see org.wesnoth.wml.WmlPackage#getCampaignType()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface CampaignType extends Type
|
||||
{
|
||||
} // CampaignType
|
||||
*/
|
||||
package org.wesnoth.wml;
|
||||
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Campaign Type</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
*
|
||||
* @see org.wesnoth.wml.WmlPackage#getCampaignType()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface CampaignType extends Type
|
||||
{
|
||||
} // CampaignType
|
||||
|
|
|
@ -1,72 +1,72 @@
|
|||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
|
||||
*/
|
||||
package org.wesnoth.wml;
|
||||
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Entity</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* <p>
|
||||
* The following features are supported:
|
||||
* <ul>
|
||||
* <li>{@link org.wesnoth.wml.Entity#getExtends <em>Extends</em>}</li>
|
||||
* <li>{@link org.wesnoth.wml.Entity#getProperties <em>Properties</em>}</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*
|
||||
* @see org.wesnoth.wml.WmlPackage#getEntity()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface Entity extends Type
|
||||
{
|
||||
/**
|
||||
* Returns the value of the '<em><b>Extends</b></em>' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Extends</em>' reference isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Extends</em>' reference.
|
||||
* @see #setExtends(Entity)
|
||||
* @see org.wesnoth.wml.WmlPackage#getEntity_Extends()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
Entity getExtends();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link org.wesnoth.wml.Entity#getExtends <em>Extends</em>}' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Extends</em>' reference.
|
||||
* @see #getExtends()
|
||||
* @generated
|
||||
*/
|
||||
void setExtends(Entity value);
|
||||
|
||||
/**
|
||||
* Returns the value of the '<em><b>Properties</b></em>' containment reference list.
|
||||
* The list contents are of type {@link org.wesnoth.wml.Property}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Properties</em>' containment reference list.
|
||||
* @see org.wesnoth.wml.WmlPackage#getEntity_Properties()
|
||||
* @model containment="true"
|
||||
* @generated
|
||||
*/
|
||||
EList<Property> getProperties();
|
||||
|
||||
} // Entity
|
||||
*/
|
||||
package org.wesnoth.wml;
|
||||
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Entity</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* <p>
|
||||
* The following features are supported:
|
||||
* <ul>
|
||||
* <li>{@link org.wesnoth.wml.Entity#getExtends <em>Extends</em>}</li>
|
||||
* <li>{@link org.wesnoth.wml.Entity#getProperties <em>Properties</em>}</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*
|
||||
* @see org.wesnoth.wml.WmlPackage#getEntity()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface Entity extends Type
|
||||
{
|
||||
/**
|
||||
* Returns the value of the '<em><b>Extends</b></em>' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Extends</em>' reference isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Extends</em>' reference.
|
||||
* @see #setExtends(Entity)
|
||||
* @see org.wesnoth.wml.WmlPackage#getEntity_Extends()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
Entity getExtends();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link org.wesnoth.wml.Entity#getExtends <em>Extends</em>}' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Extends</em>' reference.
|
||||
* @see #getExtends()
|
||||
* @generated
|
||||
*/
|
||||
void setExtends(Entity value);
|
||||
|
||||
/**
|
||||
* Returns the value of the '<em><b>Properties</b></em>' containment reference list.
|
||||
* The list contents are of type {@link org.wesnoth.wml.Property}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Properties</em>' containment reference list.
|
||||
* @see org.wesnoth.wml.WmlPackage#getEntity_Properties()
|
||||
* @model containment="true"
|
||||
* @generated
|
||||
*/
|
||||
EList<Property> getProperties();
|
||||
|
||||
} // Entity
|
||||
|
|
|
@ -1,55 +1,55 @@
|
|||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
|
||||
*/
|
||||
package org.wesnoth.wml;
|
||||
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Import</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* <p>
|
||||
* The following features are supported:
|
||||
* <ul>
|
||||
* <li>{@link org.wesnoth.wml.Import#getImportURI <em>Import URI</em>}</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*
|
||||
* @see org.wesnoth.wml.WmlPackage#getImport()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface Import extends EObject
|
||||
{
|
||||
/**
|
||||
* Returns the value of the '<em><b>Import URI</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Import URI</em>' attribute isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Import URI</em>' attribute.
|
||||
* @see #setImportURI(String)
|
||||
* @see org.wesnoth.wml.WmlPackage#getImport_ImportURI()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
String getImportURI();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link org.wesnoth.wml.Import#getImportURI <em>Import URI</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Import URI</em>' attribute.
|
||||
* @see #getImportURI()
|
||||
* @generated
|
||||
*/
|
||||
void setImportURI(String value);
|
||||
|
||||
} // Import
|
||||
*/
|
||||
package org.wesnoth.wml;
|
||||
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Import</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* <p>
|
||||
* The following features are supported:
|
||||
* <ul>
|
||||
* <li>{@link org.wesnoth.wml.Import#getImportURI <em>Import URI</em>}</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*
|
||||
* @see org.wesnoth.wml.WmlPackage#getImport()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface Import extends EObject
|
||||
{
|
||||
/**
|
||||
* Returns the value of the '<em><b>Import URI</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Import URI</em>' attribute isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Import URI</em>' attribute.
|
||||
* @see #setImportURI(String)
|
||||
* @see org.wesnoth.wml.WmlPackage#getImport_ImportURI()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
String getImportURI();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link org.wesnoth.wml.Import#getImportURI <em>Import URI</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Import URI</em>' attribute.
|
||||
* @see #getImportURI()
|
||||
* @generated
|
||||
*/
|
||||
void setImportURI(String value);
|
||||
|
||||
} // Import
|
||||
|
|
|
@ -1,64 +1,64 @@
|
|||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
|
||||
*/
|
||||
package org.wesnoth.wml;
|
||||
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Model</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* <p>
|
||||
* The following features are supported:
|
||||
* <ul>
|
||||
* <li>{@link org.wesnoth.wml.Model#getImports <em>Imports</em>}</li>
|
||||
* <li>{@link org.wesnoth.wml.Model#getElements <em>Elements</em>}</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*
|
||||
* @see org.wesnoth.wml.WmlPackage#getModel()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface Model extends EObject
|
||||
{
|
||||
/**
|
||||
* Returns the value of the '<em><b>Imports</b></em>' containment reference list.
|
||||
* The list contents are of type {@link org.wesnoth.wml.Import}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Imports</em>' containment reference list isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Imports</em>' containment reference list.
|
||||
* @see org.wesnoth.wml.WmlPackage#getModel_Imports()
|
||||
* @model containment="true"
|
||||
* @generated
|
||||
*/
|
||||
EList<Import> getImports();
|
||||
|
||||
/**
|
||||
* Returns the value of the '<em><b>Elements</b></em>' containment reference list.
|
||||
* The list contents are of type {@link org.wesnoth.wml.Type}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Elements</em>' containment reference list isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Elements</em>' containment reference list.
|
||||
* @see org.wesnoth.wml.WmlPackage#getModel_Elements()
|
||||
* @model containment="true"
|
||||
* @generated
|
||||
*/
|
||||
EList<Type> getElements();
|
||||
|
||||
} // Model
|
||||
*/
|
||||
package org.wesnoth.wml;
|
||||
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Model</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* <p>
|
||||
* The following features are supported:
|
||||
* <ul>
|
||||
* <li>{@link org.wesnoth.wml.Model#getImports <em>Imports</em>}</li>
|
||||
* <li>{@link org.wesnoth.wml.Model#getElements <em>Elements</em>}</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*
|
||||
* @see org.wesnoth.wml.WmlPackage#getModel()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface Model extends EObject
|
||||
{
|
||||
/**
|
||||
* Returns the value of the '<em><b>Imports</b></em>' containment reference list.
|
||||
* The list contents are of type {@link org.wesnoth.wml.Import}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Imports</em>' containment reference list isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Imports</em>' containment reference list.
|
||||
* @see org.wesnoth.wml.WmlPackage#getModel_Imports()
|
||||
* @model containment="true"
|
||||
* @generated
|
||||
*/
|
||||
EList<Import> getImports();
|
||||
|
||||
/**
|
||||
* Returns the value of the '<em><b>Elements</b></em>' containment reference list.
|
||||
* The list contents are of type {@link org.wesnoth.wml.Type}.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Elements</em>' containment reference list isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Elements</em>' containment reference list.
|
||||
* @see org.wesnoth.wml.WmlPackage#getModel_Elements()
|
||||
* @model containment="true"
|
||||
* @generated
|
||||
*/
|
||||
EList<Type> getElements();
|
||||
|
||||
} // Model
|
||||
|
|
|
@ -1,109 +1,109 @@
|
|||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
|
||||
*/
|
||||
package org.wesnoth.wml;
|
||||
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Property</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* <p>
|
||||
* The following features are supported:
|
||||
* <ul>
|
||||
* <li>{@link org.wesnoth.wml.Property#getName <em>Name</em>}</li>
|
||||
* <li>{@link org.wesnoth.wml.Property#getType <em>Type</em>}</li>
|
||||
* <li>{@link org.wesnoth.wml.Property#isMany <em>Many</em>}</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*
|
||||
* @see org.wesnoth.wml.WmlPackage#getProperty()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface Property extends EObject
|
||||
{
|
||||
/**
|
||||
* Returns the value of the '<em><b>Name</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Name</em>' attribute isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Name</em>' attribute.
|
||||
* @see #setName(String)
|
||||
* @see org.wesnoth.wml.WmlPackage#getProperty_Name()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link org.wesnoth.wml.Property#getName <em>Name</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Name</em>' attribute.
|
||||
* @see #getName()
|
||||
* @generated
|
||||
*/
|
||||
void setName(String value);
|
||||
|
||||
/**
|
||||
* Returns the value of the '<em><b>Type</b></em>' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Type</em>' reference isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Type</em>' reference.
|
||||
* @see #setType(Type)
|
||||
* @see org.wesnoth.wml.WmlPackage#getProperty_Type()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
Type getType();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link org.wesnoth.wml.Property#getType <em>Type</em>}' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Type</em>' reference.
|
||||
* @see #getType()
|
||||
* @generated
|
||||
*/
|
||||
void setType(Type value);
|
||||
|
||||
/**
|
||||
* Returns the value of the '<em><b>Many</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Many</em>' attribute isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Many</em>' attribute.
|
||||
* @see #setMany(boolean)
|
||||
* @see org.wesnoth.wml.WmlPackage#getProperty_Many()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
boolean isMany();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link org.wesnoth.wml.Property#isMany <em>Many</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Many</em>' attribute.
|
||||
* @see #isMany()
|
||||
* @generated
|
||||
*/
|
||||
void setMany(boolean value);
|
||||
|
||||
} // Property
|
||||
*/
|
||||
package org.wesnoth.wml;
|
||||
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Property</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* <p>
|
||||
* The following features are supported:
|
||||
* <ul>
|
||||
* <li>{@link org.wesnoth.wml.Property#getName <em>Name</em>}</li>
|
||||
* <li>{@link org.wesnoth.wml.Property#getType <em>Type</em>}</li>
|
||||
* <li>{@link org.wesnoth.wml.Property#isMany <em>Many</em>}</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*
|
||||
* @see org.wesnoth.wml.WmlPackage#getProperty()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface Property extends EObject
|
||||
{
|
||||
/**
|
||||
* Returns the value of the '<em><b>Name</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Name</em>' attribute isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Name</em>' attribute.
|
||||
* @see #setName(String)
|
||||
* @see org.wesnoth.wml.WmlPackage#getProperty_Name()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link org.wesnoth.wml.Property#getName <em>Name</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Name</em>' attribute.
|
||||
* @see #getName()
|
||||
* @generated
|
||||
*/
|
||||
void setName(String value);
|
||||
|
||||
/**
|
||||
* Returns the value of the '<em><b>Type</b></em>' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Type</em>' reference isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Type</em>' reference.
|
||||
* @see #setType(Type)
|
||||
* @see org.wesnoth.wml.WmlPackage#getProperty_Type()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
Type getType();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link org.wesnoth.wml.Property#getType <em>Type</em>}' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Type</em>' reference.
|
||||
* @see #getType()
|
||||
* @generated
|
||||
*/
|
||||
void setType(Type value);
|
||||
|
||||
/**
|
||||
* Returns the value of the '<em><b>Many</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Many</em>' attribute isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Many</em>' attribute.
|
||||
* @see #setMany(boolean)
|
||||
* @see org.wesnoth.wml.WmlPackage#getProperty_Many()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
boolean isMany();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link org.wesnoth.wml.Property#isMany <em>Many</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Many</em>' attribute.
|
||||
* @see #isMany()
|
||||
* @generated
|
||||
*/
|
||||
void setMany(boolean value);
|
||||
|
||||
} // Property
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
|
||||
*/
|
||||
package org.wesnoth.wml;
|
||||
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Simple Type</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
*
|
||||
* @see org.wesnoth.wml.WmlPackage#getSimpleType()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface SimpleType extends Type
|
||||
{
|
||||
} // SimpleType
|
||||
*/
|
||||
package org.wesnoth.wml;
|
||||
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Simple Type</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
*
|
||||
* @see org.wesnoth.wml.WmlPackage#getSimpleType()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface SimpleType extends Type
|
||||
{
|
||||
} // SimpleType
|
||||
|
|
|
@ -1,55 +1,55 @@
|
|||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
|
||||
*/
|
||||
package org.wesnoth.wml;
|
||||
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Type</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* <p>
|
||||
* The following features are supported:
|
||||
* <ul>
|
||||
* <li>{@link org.wesnoth.wml.Type#getName <em>Name</em>}</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*
|
||||
* @see org.wesnoth.wml.WmlPackage#getType()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface Type extends EObject
|
||||
{
|
||||
/**
|
||||
* Returns the value of the '<em><b>Name</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Name</em>' attribute isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Name</em>' attribute.
|
||||
* @see #setName(String)
|
||||
* @see org.wesnoth.wml.WmlPackage#getType_Name()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link org.wesnoth.wml.Type#getName <em>Name</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Name</em>' attribute.
|
||||
* @see #getName()
|
||||
* @generated
|
||||
*/
|
||||
void setName(String value);
|
||||
|
||||
} // Type
|
||||
*/
|
||||
package org.wesnoth.wml;
|
||||
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* A representation of the model object '<em><b>Type</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
*
|
||||
* <p>
|
||||
* The following features are supported:
|
||||
* <ul>
|
||||
* <li>{@link org.wesnoth.wml.Type#getName <em>Name</em>}</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*
|
||||
* @see org.wesnoth.wml.WmlPackage#getType()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
public interface Type extends EObject
|
||||
{
|
||||
/**
|
||||
* Returns the value of the '<em><b>Name</b></em>' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <p>
|
||||
* If the meaning of the '<em>Name</em>' attribute isn't clear,
|
||||
* there really should be more of a description here...
|
||||
* </p>
|
||||
* <!-- end-user-doc -->
|
||||
* @return the value of the '<em>Name</em>' attribute.
|
||||
* @see #setName(String)
|
||||
* @see org.wesnoth.wml.WmlPackage#getType_Name()
|
||||
* @model
|
||||
* @generated
|
||||
*/
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Sets the value of the '{@link org.wesnoth.wml.Type#getName <em>Name</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param value the new value of the '<em>Name</em>' attribute.
|
||||
* @see #getName()
|
||||
* @generated
|
||||
*/
|
||||
void setName(String value);
|
||||
|
||||
} // Type
|
||||
|
|
|
@ -1,101 +1,101 @@
|
|||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
|
||||
*/
|
||||
package org.wesnoth.wml;
|
||||
|
||||
import org.eclipse.emf.ecore.EFactory;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* The <b>Factory</b> for the model.
|
||||
* It provides a create method for each non-abstract class of the model.
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.wesnoth.wml.WmlPackage
|
||||
* @generated
|
||||
*/
|
||||
public interface WmlFactory extends EFactory
|
||||
{
|
||||
/**
|
||||
* The singleton instance of the factory.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
WmlFactory eINSTANCE = org.wesnoth.wml.impl.WmlFactoryImpl.init();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>Model</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>Model</em>'.
|
||||
* @generated
|
||||
*/
|
||||
Model createModel();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>Import</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>Import</em>'.
|
||||
* @generated
|
||||
*/
|
||||
Import createImport();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>Type</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>Type</em>'.
|
||||
* @generated
|
||||
*/
|
||||
Type createType();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>Simple Type</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>Simple Type</em>'.
|
||||
* @generated
|
||||
*/
|
||||
SimpleType createSimpleType();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>Campaign Type</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>Campaign Type</em>'.
|
||||
* @generated
|
||||
*/
|
||||
CampaignType createCampaignType();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>Entity</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>Entity</em>'.
|
||||
* @generated
|
||||
*/
|
||||
Entity createEntity();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>Property</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>Property</em>'.
|
||||
* @generated
|
||||
*/
|
||||
Property createProperty();
|
||||
|
||||
/**
|
||||
* Returns the package supported by this factory.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the package supported by this factory.
|
||||
* @generated
|
||||
*/
|
||||
WmlPackage getWmlPackage();
|
||||
|
||||
} //WmlFactory
|
||||
*/
|
||||
package org.wesnoth.wml;
|
||||
|
||||
import org.eclipse.emf.ecore.EFactory;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* The <b>Factory</b> for the model.
|
||||
* It provides a create method for each non-abstract class of the model.
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.wesnoth.wml.WmlPackage
|
||||
* @generated
|
||||
*/
|
||||
public interface WmlFactory extends EFactory
|
||||
{
|
||||
/**
|
||||
* The singleton instance of the factory.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
WmlFactory eINSTANCE = org.wesnoth.wml.impl.WmlFactoryImpl.init();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>Model</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>Model</em>'.
|
||||
* @generated
|
||||
*/
|
||||
Model createModel();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>Import</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>Import</em>'.
|
||||
* @generated
|
||||
*/
|
||||
Import createImport();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>Type</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>Type</em>'.
|
||||
* @generated
|
||||
*/
|
||||
Type createType();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>Simple Type</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>Simple Type</em>'.
|
||||
* @generated
|
||||
*/
|
||||
SimpleType createSimpleType();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>Campaign Type</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>Campaign Type</em>'.
|
||||
* @generated
|
||||
*/
|
||||
CampaignType createCampaignType();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>Entity</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>Entity</em>'.
|
||||
* @generated
|
||||
*/
|
||||
Entity createEntity();
|
||||
|
||||
/**
|
||||
* Returns a new object of class '<em>Property</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return a new object of class '<em>Property</em>'.
|
||||
* @generated
|
||||
*/
|
||||
Property createProperty();
|
||||
|
||||
/**
|
||||
* Returns the package supported by this factory.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the package supported by this factory.
|
||||
* @generated
|
||||
*/
|
||||
WmlPackage getWmlPackage();
|
||||
|
||||
} //WmlFactory
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,46 +1,46 @@
|
|||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
|
||||
*/
|
||||
package org.wesnoth.wml.impl;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
|
||||
import org.wesnoth.wml.CampaignType;
|
||||
import org.wesnoth.wml.WmlPackage;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Campaign Type</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* </p>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class CampaignTypeImpl extends TypeImpl implements CampaignType
|
||||
{
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected CampaignTypeImpl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass()
|
||||
{
|
||||
return WmlPackage.Literals.CAMPAIGN_TYPE;
|
||||
}
|
||||
|
||||
} //CampaignTypeImpl
|
||||
*/
|
||||
package org.wesnoth.wml.impl;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
|
||||
import org.wesnoth.wml.CampaignType;
|
||||
import org.wesnoth.wml.WmlPackage;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Campaign Type</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* </p>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class CampaignTypeImpl extends TypeImpl implements CampaignType
|
||||
{
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected CampaignTypeImpl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass()
|
||||
{
|
||||
return WmlPackage.Literals.CAMPAIGN_TYPE;
|
||||
}
|
||||
|
||||
} //CampaignTypeImpl
|
||||
|
|
|
@ -1,237 +1,237 @@
|
|||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
|
||||
*/
|
||||
package org.wesnoth.wml.impl;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.eclipse.emf.common.notify.Notification;
|
||||
import org.eclipse.emf.common.notify.NotificationChain;
|
||||
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.InternalEObject;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||
|
||||
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
|
||||
import org.eclipse.emf.ecore.util.InternalEList;
|
||||
|
||||
import org.wesnoth.wml.Entity;
|
||||
import org.wesnoth.wml.Property;
|
||||
import org.wesnoth.wml.WmlPackage;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Entity</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* <ul>
|
||||
* <li>{@link org.wesnoth.wml.impl.EntityImpl#getExtends <em>Extends</em>}</li>
|
||||
* <li>{@link org.wesnoth.wml.impl.EntityImpl#getProperties <em>Properties</em>}</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class EntityImpl extends TypeImpl implements Entity
|
||||
{
|
||||
/**
|
||||
* The cached value of the '{@link #getExtends() <em>Extends</em>}' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getExtends()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected Entity extends_;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getProperties()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected EList<Property> properties;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected EntityImpl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass()
|
||||
{
|
||||
return WmlPackage.Literals.ENTITY;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Entity getExtends()
|
||||
{
|
||||
if (extends_ != null && extends_.eIsProxy())
|
||||
{
|
||||
InternalEObject oldExtends = (InternalEObject)extends_;
|
||||
extends_ = (Entity)eResolveProxy(oldExtends);
|
||||
if (extends_ != oldExtends)
|
||||
{
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.RESOLVE, WmlPackage.ENTITY__EXTENDS, oldExtends, extends_));
|
||||
}
|
||||
}
|
||||
return extends_;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Entity basicGetExtends()
|
||||
{
|
||||
return extends_;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setExtends(Entity newExtends)
|
||||
{
|
||||
Entity oldExtends = extends_;
|
||||
extends_ = newExtends;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, WmlPackage.ENTITY__EXTENDS, oldExtends, extends_));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<Property> getProperties()
|
||||
{
|
||||
if (properties == null)
|
||||
{
|
||||
properties = new EObjectContainmentEList<Property>(Property.class, this, WmlPackage.ENTITY__PROPERTIES);
|
||||
}
|
||||
return properties;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.ENTITY__PROPERTIES:
|
||||
return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
|
||||
}
|
||||
return super.eInverseRemove(otherEnd, featureID, msgs);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object eGet(int featureID, boolean resolve, boolean coreType)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.ENTITY__EXTENDS:
|
||||
if (resolve) return getExtends();
|
||||
return basicGetExtends();
|
||||
case WmlPackage.ENTITY__PROPERTIES:
|
||||
return getProperties();
|
||||
}
|
||||
return super.eGet(featureID, resolve, coreType);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void eSet(int featureID, Object newValue)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.ENTITY__EXTENDS:
|
||||
setExtends((Entity)newValue);
|
||||
return;
|
||||
case WmlPackage.ENTITY__PROPERTIES:
|
||||
getProperties().clear();
|
||||
getProperties().addAll((Collection<? extends Property>)newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.ENTITY__EXTENDS:
|
||||
setExtends((Entity)null);
|
||||
return;
|
||||
case WmlPackage.ENTITY__PROPERTIES:
|
||||
getProperties().clear();
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.ENTITY__EXTENDS:
|
||||
return extends_ != null;
|
||||
case WmlPackage.ENTITY__PROPERTIES:
|
||||
return properties != null && !properties.isEmpty();
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
} //EntityImpl
|
||||
*/
|
||||
package org.wesnoth.wml.impl;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.eclipse.emf.common.notify.Notification;
|
||||
import org.eclipse.emf.common.notify.NotificationChain;
|
||||
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.InternalEObject;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||
|
||||
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
|
||||
import org.eclipse.emf.ecore.util.InternalEList;
|
||||
|
||||
import org.wesnoth.wml.Entity;
|
||||
import org.wesnoth.wml.Property;
|
||||
import org.wesnoth.wml.WmlPackage;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Entity</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* <ul>
|
||||
* <li>{@link org.wesnoth.wml.impl.EntityImpl#getExtends <em>Extends</em>}</li>
|
||||
* <li>{@link org.wesnoth.wml.impl.EntityImpl#getProperties <em>Properties</em>}</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class EntityImpl extends TypeImpl implements Entity
|
||||
{
|
||||
/**
|
||||
* The cached value of the '{@link #getExtends() <em>Extends</em>}' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getExtends()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected Entity extends_;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getProperties()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected EList<Property> properties;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected EntityImpl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass()
|
||||
{
|
||||
return WmlPackage.Literals.ENTITY;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Entity getExtends()
|
||||
{
|
||||
if (extends_ != null && extends_.eIsProxy())
|
||||
{
|
||||
InternalEObject oldExtends = (InternalEObject)extends_;
|
||||
extends_ = (Entity)eResolveProxy(oldExtends);
|
||||
if (extends_ != oldExtends)
|
||||
{
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.RESOLVE, WmlPackage.ENTITY__EXTENDS, oldExtends, extends_));
|
||||
}
|
||||
}
|
||||
return extends_;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Entity basicGetExtends()
|
||||
{
|
||||
return extends_;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setExtends(Entity newExtends)
|
||||
{
|
||||
Entity oldExtends = extends_;
|
||||
extends_ = newExtends;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, WmlPackage.ENTITY__EXTENDS, oldExtends, extends_));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<Property> getProperties()
|
||||
{
|
||||
if (properties == null)
|
||||
{
|
||||
properties = new EObjectContainmentEList<Property>(Property.class, this, WmlPackage.ENTITY__PROPERTIES);
|
||||
}
|
||||
return properties;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.ENTITY__PROPERTIES:
|
||||
return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
|
||||
}
|
||||
return super.eInverseRemove(otherEnd, featureID, msgs);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object eGet(int featureID, boolean resolve, boolean coreType)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.ENTITY__EXTENDS:
|
||||
if (resolve) return getExtends();
|
||||
return basicGetExtends();
|
||||
case WmlPackage.ENTITY__PROPERTIES:
|
||||
return getProperties();
|
||||
}
|
||||
return super.eGet(featureID, resolve, coreType);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void eSet(int featureID, Object newValue)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.ENTITY__EXTENDS:
|
||||
setExtends((Entity)newValue);
|
||||
return;
|
||||
case WmlPackage.ENTITY__PROPERTIES:
|
||||
getProperties().clear();
|
||||
getProperties().addAll((Collection<? extends Property>)newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.ENTITY__EXTENDS:
|
||||
setExtends((Entity)null);
|
||||
return;
|
||||
case WmlPackage.ENTITY__PROPERTIES:
|
||||
getProperties().clear();
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.ENTITY__EXTENDS:
|
||||
return extends_ != null;
|
||||
case WmlPackage.ENTITY__PROPERTIES:
|
||||
return properties != null && !properties.isEmpty();
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
} //EntityImpl
|
||||
|
|
|
@ -1,181 +1,181 @@
|
|||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
|
||||
*/
|
||||
package org.wesnoth.wml.impl;
|
||||
|
||||
import org.eclipse.emf.common.notify.Notification;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
||||
|
||||
import org.wesnoth.wml.Import;
|
||||
import org.wesnoth.wml.WmlPackage;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Import</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* <ul>
|
||||
* <li>{@link org.wesnoth.wml.impl.ImportImpl#getImportURI <em>Import URI</em>}</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class ImportImpl extends MinimalEObjectImpl.Container implements Import
|
||||
{
|
||||
/**
|
||||
* The default value of the '{@link #getImportURI() <em>Import URI</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getImportURI()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String IMPORT_URI_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getImportURI() <em>Import URI</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getImportURI()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String importURI = IMPORT_URI_EDEFAULT;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected ImportImpl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass()
|
||||
{
|
||||
return WmlPackage.Literals.IMPORT;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getImportURI()
|
||||
{
|
||||
return importURI;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setImportURI(String newImportURI)
|
||||
{
|
||||
String oldImportURI = importURI;
|
||||
importURI = newImportURI;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, WmlPackage.IMPORT__IMPORT_URI, oldImportURI, importURI));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object eGet(int featureID, boolean resolve, boolean coreType)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.IMPORT__IMPORT_URI:
|
||||
return getImportURI();
|
||||
}
|
||||
return super.eGet(featureID, resolve, coreType);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eSet(int featureID, Object newValue)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.IMPORT__IMPORT_URI:
|
||||
setImportURI((String)newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.IMPORT__IMPORT_URI:
|
||||
setImportURI(IMPORT_URI_EDEFAULT);
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.IMPORT__IMPORT_URI:
|
||||
return IMPORT_URI_EDEFAULT == null ? importURI != null : !IMPORT_URI_EDEFAULT.equals(importURI);
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
if (eIsProxy()) return super.toString();
|
||||
|
||||
StringBuffer result = new StringBuffer(super.toString());
|
||||
result.append(" (importURI: ");
|
||||
result.append(importURI);
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
} //ImportImpl
|
||||
*/
|
||||
package org.wesnoth.wml.impl;
|
||||
|
||||
import org.eclipse.emf.common.notify.Notification;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
||||
|
||||
import org.wesnoth.wml.Import;
|
||||
import org.wesnoth.wml.WmlPackage;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Import</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* <ul>
|
||||
* <li>{@link org.wesnoth.wml.impl.ImportImpl#getImportURI <em>Import URI</em>}</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class ImportImpl extends MinimalEObjectImpl.Container implements Import
|
||||
{
|
||||
/**
|
||||
* The default value of the '{@link #getImportURI() <em>Import URI</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getImportURI()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String IMPORT_URI_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getImportURI() <em>Import URI</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getImportURI()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String importURI = IMPORT_URI_EDEFAULT;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected ImportImpl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass()
|
||||
{
|
||||
return WmlPackage.Literals.IMPORT;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getImportURI()
|
||||
{
|
||||
return importURI;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setImportURI(String newImportURI)
|
||||
{
|
||||
String oldImportURI = importURI;
|
||||
importURI = newImportURI;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, WmlPackage.IMPORT__IMPORT_URI, oldImportURI, importURI));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object eGet(int featureID, boolean resolve, boolean coreType)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.IMPORT__IMPORT_URI:
|
||||
return getImportURI();
|
||||
}
|
||||
return super.eGet(featureID, resolve, coreType);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eSet(int featureID, Object newValue)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.IMPORT__IMPORT_URI:
|
||||
setImportURI((String)newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.IMPORT__IMPORT_URI:
|
||||
setImportURI(IMPORT_URI_EDEFAULT);
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.IMPORT__IMPORT_URI:
|
||||
return IMPORT_URI_EDEFAULT == null ? importURI != null : !IMPORT_URI_EDEFAULT.equals(importURI);
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
if (eIsProxy()) return super.toString();
|
||||
|
||||
StringBuffer result = new StringBuffer(super.toString());
|
||||
result.append(" (importURI: ");
|
||||
result.append(importURI);
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
} //ImportImpl
|
||||
|
|
|
@ -1,210 +1,210 @@
|
|||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
|
||||
*/
|
||||
package org.wesnoth.wml.impl;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.eclipse.emf.common.notify.NotificationChain;
|
||||
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.InternalEObject;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
||||
|
||||
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
|
||||
import org.eclipse.emf.ecore.util.InternalEList;
|
||||
|
||||
import org.wesnoth.wml.Import;
|
||||
import org.wesnoth.wml.Model;
|
||||
import org.wesnoth.wml.Type;
|
||||
import org.wesnoth.wml.WmlPackage;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Model</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* <ul>
|
||||
* <li>{@link org.wesnoth.wml.impl.ModelImpl#getImports <em>Imports</em>}</li>
|
||||
* <li>{@link org.wesnoth.wml.impl.ModelImpl#getElements <em>Elements</em>}</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class ModelImpl extends MinimalEObjectImpl.Container implements Model
|
||||
{
|
||||
/**
|
||||
* The cached value of the '{@link #getImports() <em>Imports</em>}' containment reference list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getImports()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected EList<Import> imports;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getElements() <em>Elements</em>}' containment reference list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getElements()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected EList<Type> elements;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected ModelImpl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass()
|
||||
{
|
||||
return WmlPackage.Literals.MODEL;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<Import> getImports()
|
||||
{
|
||||
if (imports == null)
|
||||
{
|
||||
imports = new EObjectContainmentEList<Import>(Import.class, this, WmlPackage.MODEL__IMPORTS);
|
||||
}
|
||||
return imports;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<Type> getElements()
|
||||
{
|
||||
if (elements == null)
|
||||
{
|
||||
elements = new EObjectContainmentEList<Type>(Type.class, this, WmlPackage.MODEL__ELEMENTS);
|
||||
}
|
||||
return elements;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.MODEL__IMPORTS:
|
||||
return ((InternalEList<?>)getImports()).basicRemove(otherEnd, msgs);
|
||||
case WmlPackage.MODEL__ELEMENTS:
|
||||
return ((InternalEList<?>)getElements()).basicRemove(otherEnd, msgs);
|
||||
}
|
||||
return super.eInverseRemove(otherEnd, featureID, msgs);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object eGet(int featureID, boolean resolve, boolean coreType)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.MODEL__IMPORTS:
|
||||
return getImports();
|
||||
case WmlPackage.MODEL__ELEMENTS:
|
||||
return getElements();
|
||||
}
|
||||
return super.eGet(featureID, resolve, coreType);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void eSet(int featureID, Object newValue)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.MODEL__IMPORTS:
|
||||
getImports().clear();
|
||||
getImports().addAll((Collection<? extends Import>)newValue);
|
||||
return;
|
||||
case WmlPackage.MODEL__ELEMENTS:
|
||||
getElements().clear();
|
||||
getElements().addAll((Collection<? extends Type>)newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.MODEL__IMPORTS:
|
||||
getImports().clear();
|
||||
return;
|
||||
case WmlPackage.MODEL__ELEMENTS:
|
||||
getElements().clear();
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.MODEL__IMPORTS:
|
||||
return imports != null && !imports.isEmpty();
|
||||
case WmlPackage.MODEL__ELEMENTS:
|
||||
return elements != null && !elements.isEmpty();
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
} //ModelImpl
|
||||
*/
|
||||
package org.wesnoth.wml.impl;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.eclipse.emf.common.notify.NotificationChain;
|
||||
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.InternalEObject;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
||||
|
||||
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
|
||||
import org.eclipse.emf.ecore.util.InternalEList;
|
||||
|
||||
import org.wesnoth.wml.Import;
|
||||
import org.wesnoth.wml.Model;
|
||||
import org.wesnoth.wml.Type;
|
||||
import org.wesnoth.wml.WmlPackage;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Model</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* <ul>
|
||||
* <li>{@link org.wesnoth.wml.impl.ModelImpl#getImports <em>Imports</em>}</li>
|
||||
* <li>{@link org.wesnoth.wml.impl.ModelImpl#getElements <em>Elements</em>}</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class ModelImpl extends MinimalEObjectImpl.Container implements Model
|
||||
{
|
||||
/**
|
||||
* The cached value of the '{@link #getImports() <em>Imports</em>}' containment reference list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getImports()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected EList<Import> imports;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getElements() <em>Elements</em>}' containment reference list.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getElements()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected EList<Type> elements;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected ModelImpl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass()
|
||||
{
|
||||
return WmlPackage.Literals.MODEL;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<Import> getImports()
|
||||
{
|
||||
if (imports == null)
|
||||
{
|
||||
imports = new EObjectContainmentEList<Import>(Import.class, this, WmlPackage.MODEL__IMPORTS);
|
||||
}
|
||||
return imports;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<Type> getElements()
|
||||
{
|
||||
if (elements == null)
|
||||
{
|
||||
elements = new EObjectContainmentEList<Type>(Type.class, this, WmlPackage.MODEL__ELEMENTS);
|
||||
}
|
||||
return elements;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.MODEL__IMPORTS:
|
||||
return ((InternalEList<?>)getImports()).basicRemove(otherEnd, msgs);
|
||||
case WmlPackage.MODEL__ELEMENTS:
|
||||
return ((InternalEList<?>)getElements()).basicRemove(otherEnd, msgs);
|
||||
}
|
||||
return super.eInverseRemove(otherEnd, featureID, msgs);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object eGet(int featureID, boolean resolve, boolean coreType)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.MODEL__IMPORTS:
|
||||
return getImports();
|
||||
case WmlPackage.MODEL__ELEMENTS:
|
||||
return getElements();
|
||||
}
|
||||
return super.eGet(featureID, resolve, coreType);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void eSet(int featureID, Object newValue)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.MODEL__IMPORTS:
|
||||
getImports().clear();
|
||||
getImports().addAll((Collection<? extends Import>)newValue);
|
||||
return;
|
||||
case WmlPackage.MODEL__ELEMENTS:
|
||||
getElements().clear();
|
||||
getElements().addAll((Collection<? extends Type>)newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.MODEL__IMPORTS:
|
||||
getImports().clear();
|
||||
return;
|
||||
case WmlPackage.MODEL__ELEMENTS:
|
||||
getElements().clear();
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.MODEL__IMPORTS:
|
||||
return imports != null && !imports.isEmpty();
|
||||
case WmlPackage.MODEL__ELEMENTS:
|
||||
return elements != null && !elements.isEmpty();
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
} //ModelImpl
|
||||
|
|
|
@ -1,304 +1,304 @@
|
|||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
|
||||
*/
|
||||
package org.wesnoth.wml.impl;
|
||||
|
||||
import org.eclipse.emf.common.notify.Notification;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.InternalEObject;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
||||
|
||||
import org.wesnoth.wml.Property;
|
||||
import org.wesnoth.wml.Type;
|
||||
import org.wesnoth.wml.WmlPackage;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Property</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* <ul>
|
||||
* <li>{@link org.wesnoth.wml.impl.PropertyImpl#getName <em>Name</em>}</li>
|
||||
* <li>{@link org.wesnoth.wml.impl.PropertyImpl#getType <em>Type</em>}</li>
|
||||
* <li>{@link org.wesnoth.wml.impl.PropertyImpl#isMany <em>Many</em>}</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class PropertyImpl extends MinimalEObjectImpl.Container implements Property
|
||||
{
|
||||
/**
|
||||
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getName()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String NAME_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getName()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String name = NAME_EDEFAULT;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getType() <em>Type</em>}' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getType()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected Type type;
|
||||
|
||||
/**
|
||||
* The default value of the '{@link #isMany() <em>Many</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #isMany()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final boolean MANY_EDEFAULT = false;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #isMany() <em>Many</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #isMany()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected boolean many = MANY_EDEFAULT;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected PropertyImpl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass()
|
||||
{
|
||||
return WmlPackage.Literals.PROPERTY;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setName(String newName)
|
||||
{
|
||||
String oldName = name;
|
||||
name = newName;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, WmlPackage.PROPERTY__NAME, oldName, name));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Type getType()
|
||||
{
|
||||
if (type != null && type.eIsProxy())
|
||||
{
|
||||
InternalEObject oldType = (InternalEObject)type;
|
||||
type = (Type)eResolveProxy(oldType);
|
||||
if (type != oldType)
|
||||
{
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.RESOLVE, WmlPackage.PROPERTY__TYPE, oldType, type));
|
||||
}
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Type basicGetType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setType(Type newType)
|
||||
{
|
||||
Type oldType = type;
|
||||
type = newType;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, WmlPackage.PROPERTY__TYPE, oldType, type));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean isMany()
|
||||
{
|
||||
return many;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setMany(boolean newMany)
|
||||
{
|
||||
boolean oldMany = many;
|
||||
many = newMany;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, WmlPackage.PROPERTY__MANY, oldMany, many));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object eGet(int featureID, boolean resolve, boolean coreType)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.PROPERTY__NAME:
|
||||
return getName();
|
||||
case WmlPackage.PROPERTY__TYPE:
|
||||
if (resolve) return getType();
|
||||
return basicGetType();
|
||||
case WmlPackage.PROPERTY__MANY:
|
||||
return isMany();
|
||||
}
|
||||
return super.eGet(featureID, resolve, coreType);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eSet(int featureID, Object newValue)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.PROPERTY__NAME:
|
||||
setName((String)newValue);
|
||||
return;
|
||||
case WmlPackage.PROPERTY__TYPE:
|
||||
setType((Type)newValue);
|
||||
return;
|
||||
case WmlPackage.PROPERTY__MANY:
|
||||
setMany((Boolean)newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.PROPERTY__NAME:
|
||||
setName(NAME_EDEFAULT);
|
||||
return;
|
||||
case WmlPackage.PROPERTY__TYPE:
|
||||
setType((Type)null);
|
||||
return;
|
||||
case WmlPackage.PROPERTY__MANY:
|
||||
setMany(MANY_EDEFAULT);
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.PROPERTY__NAME:
|
||||
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
|
||||
case WmlPackage.PROPERTY__TYPE:
|
||||
return type != null;
|
||||
case WmlPackage.PROPERTY__MANY:
|
||||
return many != MANY_EDEFAULT;
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
if (eIsProxy()) return super.toString();
|
||||
|
||||
StringBuffer result = new StringBuffer(super.toString());
|
||||
result.append(" (name: ");
|
||||
result.append(name);
|
||||
result.append(", many: ");
|
||||
result.append(many);
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
} //PropertyImpl
|
||||
*/
|
||||
package org.wesnoth.wml.impl;
|
||||
|
||||
import org.eclipse.emf.common.notify.Notification;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.InternalEObject;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
||||
|
||||
import org.wesnoth.wml.Property;
|
||||
import org.wesnoth.wml.Type;
|
||||
import org.wesnoth.wml.WmlPackage;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Property</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* <ul>
|
||||
* <li>{@link org.wesnoth.wml.impl.PropertyImpl#getName <em>Name</em>}</li>
|
||||
* <li>{@link org.wesnoth.wml.impl.PropertyImpl#getType <em>Type</em>}</li>
|
||||
* <li>{@link org.wesnoth.wml.impl.PropertyImpl#isMany <em>Many</em>}</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class PropertyImpl extends MinimalEObjectImpl.Container implements Property
|
||||
{
|
||||
/**
|
||||
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getName()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String NAME_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getName()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String name = NAME_EDEFAULT;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getType() <em>Type</em>}' reference.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getType()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected Type type;
|
||||
|
||||
/**
|
||||
* The default value of the '{@link #isMany() <em>Many</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #isMany()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final boolean MANY_EDEFAULT = false;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #isMany() <em>Many</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #isMany()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected boolean many = MANY_EDEFAULT;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected PropertyImpl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass()
|
||||
{
|
||||
return WmlPackage.Literals.PROPERTY;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setName(String newName)
|
||||
{
|
||||
String oldName = name;
|
||||
name = newName;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, WmlPackage.PROPERTY__NAME, oldName, name));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Type getType()
|
||||
{
|
||||
if (type != null && type.eIsProxy())
|
||||
{
|
||||
InternalEObject oldType = (InternalEObject)type;
|
||||
type = (Type)eResolveProxy(oldType);
|
||||
if (type != oldType)
|
||||
{
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.RESOLVE, WmlPackage.PROPERTY__TYPE, oldType, type));
|
||||
}
|
||||
}
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Type basicGetType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setType(Type newType)
|
||||
{
|
||||
Type oldType = type;
|
||||
type = newType;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, WmlPackage.PROPERTY__TYPE, oldType, type));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public boolean isMany()
|
||||
{
|
||||
return many;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setMany(boolean newMany)
|
||||
{
|
||||
boolean oldMany = many;
|
||||
many = newMany;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, WmlPackage.PROPERTY__MANY, oldMany, many));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object eGet(int featureID, boolean resolve, boolean coreType)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.PROPERTY__NAME:
|
||||
return getName();
|
||||
case WmlPackage.PROPERTY__TYPE:
|
||||
if (resolve) return getType();
|
||||
return basicGetType();
|
||||
case WmlPackage.PROPERTY__MANY:
|
||||
return isMany();
|
||||
}
|
||||
return super.eGet(featureID, resolve, coreType);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eSet(int featureID, Object newValue)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.PROPERTY__NAME:
|
||||
setName((String)newValue);
|
||||
return;
|
||||
case WmlPackage.PROPERTY__TYPE:
|
||||
setType((Type)newValue);
|
||||
return;
|
||||
case WmlPackage.PROPERTY__MANY:
|
||||
setMany((Boolean)newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.PROPERTY__NAME:
|
||||
setName(NAME_EDEFAULT);
|
||||
return;
|
||||
case WmlPackage.PROPERTY__TYPE:
|
||||
setType((Type)null);
|
||||
return;
|
||||
case WmlPackage.PROPERTY__MANY:
|
||||
setMany(MANY_EDEFAULT);
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.PROPERTY__NAME:
|
||||
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
|
||||
case WmlPackage.PROPERTY__TYPE:
|
||||
return type != null;
|
||||
case WmlPackage.PROPERTY__MANY:
|
||||
return many != MANY_EDEFAULT;
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
if (eIsProxy()) return super.toString();
|
||||
|
||||
StringBuffer result = new StringBuffer(super.toString());
|
||||
result.append(" (name: ");
|
||||
result.append(name);
|
||||
result.append(", many: ");
|
||||
result.append(many);
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
} //PropertyImpl
|
||||
|
|
|
@ -1,46 +1,46 @@
|
|||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
|
||||
*/
|
||||
package org.wesnoth.wml.impl;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
|
||||
import org.wesnoth.wml.SimpleType;
|
||||
import org.wesnoth.wml.WmlPackage;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Simple Type</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* </p>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class SimpleTypeImpl extends TypeImpl implements SimpleType
|
||||
{
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected SimpleTypeImpl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass()
|
||||
{
|
||||
return WmlPackage.Literals.SIMPLE_TYPE;
|
||||
}
|
||||
|
||||
} //SimpleTypeImpl
|
||||
*/
|
||||
package org.wesnoth.wml.impl;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
|
||||
import org.wesnoth.wml.SimpleType;
|
||||
import org.wesnoth.wml.WmlPackage;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Simple Type</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* </p>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class SimpleTypeImpl extends TypeImpl implements SimpleType
|
||||
{
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected SimpleTypeImpl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass()
|
||||
{
|
||||
return WmlPackage.Literals.SIMPLE_TYPE;
|
||||
}
|
||||
|
||||
} //SimpleTypeImpl
|
||||
|
|
|
@ -1,181 +1,181 @@
|
|||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
|
||||
*/
|
||||
package org.wesnoth.wml.impl;
|
||||
|
||||
import org.eclipse.emf.common.notify.Notification;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
||||
|
||||
import org.wesnoth.wml.Type;
|
||||
import org.wesnoth.wml.WmlPackage;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Type</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* <ul>
|
||||
* <li>{@link org.wesnoth.wml.impl.TypeImpl#getName <em>Name</em>}</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class TypeImpl extends MinimalEObjectImpl.Container implements Type
|
||||
{
|
||||
/**
|
||||
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getName()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String NAME_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getName()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String name = NAME_EDEFAULT;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected TypeImpl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass()
|
||||
{
|
||||
return WmlPackage.Literals.TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setName(String newName)
|
||||
{
|
||||
String oldName = name;
|
||||
name = newName;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, WmlPackage.TYPE__NAME, oldName, name));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object eGet(int featureID, boolean resolve, boolean coreType)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.TYPE__NAME:
|
||||
return getName();
|
||||
}
|
||||
return super.eGet(featureID, resolve, coreType);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eSet(int featureID, Object newValue)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.TYPE__NAME:
|
||||
setName((String)newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.TYPE__NAME:
|
||||
setName(NAME_EDEFAULT);
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.TYPE__NAME:
|
||||
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
if (eIsProxy()) return super.toString();
|
||||
|
||||
StringBuffer result = new StringBuffer(super.toString());
|
||||
result.append(" (name: ");
|
||||
result.append(name);
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
} //TypeImpl
|
||||
*/
|
||||
package org.wesnoth.wml.impl;
|
||||
|
||||
import org.eclipse.emf.common.notify.Notification;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.ENotificationImpl;
|
||||
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
|
||||
|
||||
import org.wesnoth.wml.Type;
|
||||
import org.wesnoth.wml.WmlPackage;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model object '<em><b>Type</b></em>'.
|
||||
* <!-- end-user-doc -->
|
||||
* <p>
|
||||
* The following features are implemented:
|
||||
* <ul>
|
||||
* <li>{@link org.wesnoth.wml.impl.TypeImpl#getName <em>Name</em>}</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
*
|
||||
* @generated
|
||||
*/
|
||||
public class TypeImpl extends MinimalEObjectImpl.Container implements Type
|
||||
{
|
||||
/**
|
||||
* The default value of the '{@link #getName() <em>Name</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getName()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected static final String NAME_EDEFAULT = null;
|
||||
|
||||
/**
|
||||
* The cached value of the '{@link #getName() <em>Name</em>}' attribute.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #getName()
|
||||
* @generated
|
||||
* @ordered
|
||||
*/
|
||||
protected String name = NAME_EDEFAULT;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected TypeImpl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
protected EClass eStaticClass()
|
||||
{
|
||||
return WmlPackage.Literals.TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void setName(String newName)
|
||||
{
|
||||
String oldName = name;
|
||||
name = newName;
|
||||
if (eNotificationRequired())
|
||||
eNotify(new ENotificationImpl(this, Notification.SET, WmlPackage.TYPE__NAME, oldName, name));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Object eGet(int featureID, boolean resolve, boolean coreType)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.TYPE__NAME:
|
||||
return getName();
|
||||
}
|
||||
return super.eGet(featureID, resolve, coreType);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eSet(int featureID, Object newValue)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.TYPE__NAME:
|
||||
setName((String)newValue);
|
||||
return;
|
||||
}
|
||||
super.eSet(featureID, newValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public void eUnset(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.TYPE__NAME:
|
||||
setName(NAME_EDEFAULT);
|
||||
return;
|
||||
}
|
||||
super.eUnset(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean eIsSet(int featureID)
|
||||
{
|
||||
switch (featureID)
|
||||
{
|
||||
case WmlPackage.TYPE__NAME:
|
||||
return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
|
||||
}
|
||||
return super.eIsSet(featureID);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
if (eIsProxy()) return super.toString();
|
||||
|
||||
StringBuffer result = new StringBuffer(super.toString());
|
||||
result.append(" (name: ");
|
||||
result.append(name);
|
||||
result.append(')');
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
} //TypeImpl
|
||||
|
|
|
@ -1,182 +1,182 @@
|
|||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
|
||||
*/
|
||||
package org.wesnoth.wml.impl;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.eclipse.emf.ecore.EPackage;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.EFactoryImpl;
|
||||
|
||||
import org.eclipse.emf.ecore.plugin.EcorePlugin;
|
||||
|
||||
import org.wesnoth.wml.*;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model <b>Factory</b>.
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public class WmlFactoryImpl extends EFactoryImpl implements WmlFactory
|
||||
{
|
||||
/**
|
||||
* Creates the default factory implementation.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public static WmlFactory init()
|
||||
{
|
||||
try
|
||||
{
|
||||
WmlFactory theWmlFactory = (WmlFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.wesnoth.org/Wml");
|
||||
if (theWmlFactory != null)
|
||||
{
|
||||
return theWmlFactory;
|
||||
}
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
EcorePlugin.INSTANCE.log(exception);
|
||||
}
|
||||
return new WmlFactoryImpl();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an instance of the factory.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public WmlFactoryImpl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public EObject create(EClass eClass)
|
||||
{
|
||||
switch (eClass.getClassifierID())
|
||||
{
|
||||
case WmlPackage.MODEL: return createModel();
|
||||
case WmlPackage.IMPORT: return createImport();
|
||||
case WmlPackage.TYPE: return createType();
|
||||
case WmlPackage.SIMPLE_TYPE: return createSimpleType();
|
||||
case WmlPackage.CAMPAIGN_TYPE: return createCampaignType();
|
||||
case WmlPackage.ENTITY: return createEntity();
|
||||
case WmlPackage.PROPERTY: return createProperty();
|
||||
default:
|
||||
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Model createModel()
|
||||
{
|
||||
ModelImpl model = new ModelImpl();
|
||||
return model;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Import createImport()
|
||||
{
|
||||
ImportImpl import_ = new ImportImpl();
|
||||
return import_;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Type createType()
|
||||
{
|
||||
TypeImpl type = new TypeImpl();
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public SimpleType createSimpleType()
|
||||
{
|
||||
SimpleTypeImpl simpleType = new SimpleTypeImpl();
|
||||
return simpleType;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public CampaignType createCampaignType()
|
||||
{
|
||||
CampaignTypeImpl campaignType = new CampaignTypeImpl();
|
||||
return campaignType;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Entity createEntity()
|
||||
{
|
||||
EntityImpl entity = new EntityImpl();
|
||||
return entity;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Property createProperty()
|
||||
{
|
||||
PropertyImpl property = new PropertyImpl();
|
||||
return property;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public WmlPackage getWmlPackage()
|
||||
{
|
||||
return (WmlPackage)getEPackage();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @deprecated
|
||||
* @generated
|
||||
*/
|
||||
@Deprecated
|
||||
public static WmlPackage getPackage()
|
||||
{
|
||||
return WmlPackage.eINSTANCE;
|
||||
}
|
||||
|
||||
} //WmlFactoryImpl
|
||||
*/
|
||||
package org.wesnoth.wml.impl;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.eclipse.emf.ecore.EPackage;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.EFactoryImpl;
|
||||
|
||||
import org.eclipse.emf.ecore.plugin.EcorePlugin;
|
||||
|
||||
import org.wesnoth.wml.*;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model <b>Factory</b>.
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public class WmlFactoryImpl extends EFactoryImpl implements WmlFactory
|
||||
{
|
||||
/**
|
||||
* Creates the default factory implementation.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public static WmlFactory init()
|
||||
{
|
||||
try
|
||||
{
|
||||
WmlFactory theWmlFactory = (WmlFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.wesnoth.org/Wml");
|
||||
if (theWmlFactory != null)
|
||||
{
|
||||
return theWmlFactory;
|
||||
}
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
EcorePlugin.INSTANCE.log(exception);
|
||||
}
|
||||
return new WmlFactoryImpl();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an instance of the factory.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public WmlFactoryImpl()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public EObject create(EClass eClass)
|
||||
{
|
||||
switch (eClass.getClassifierID())
|
||||
{
|
||||
case WmlPackage.MODEL: return createModel();
|
||||
case WmlPackage.IMPORT: return createImport();
|
||||
case WmlPackage.TYPE: return createType();
|
||||
case WmlPackage.SIMPLE_TYPE: return createSimpleType();
|
||||
case WmlPackage.CAMPAIGN_TYPE: return createCampaignType();
|
||||
case WmlPackage.ENTITY: return createEntity();
|
||||
case WmlPackage.PROPERTY: return createProperty();
|
||||
default:
|
||||
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Model createModel()
|
||||
{
|
||||
ModelImpl model = new ModelImpl();
|
||||
return model;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Import createImport()
|
||||
{
|
||||
ImportImpl import_ = new ImportImpl();
|
||||
return import_;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Type createType()
|
||||
{
|
||||
TypeImpl type = new TypeImpl();
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public SimpleType createSimpleType()
|
||||
{
|
||||
SimpleTypeImpl simpleType = new SimpleTypeImpl();
|
||||
return simpleType;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public CampaignType createCampaignType()
|
||||
{
|
||||
CampaignTypeImpl campaignType = new CampaignTypeImpl();
|
||||
return campaignType;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Entity createEntity()
|
||||
{
|
||||
EntityImpl entity = new EntityImpl();
|
||||
return entity;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public Property createProperty()
|
||||
{
|
||||
PropertyImpl property = new PropertyImpl();
|
||||
return property;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public WmlPackage getWmlPackage()
|
||||
{
|
||||
return (WmlPackage)getEPackage();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @deprecated
|
||||
* @generated
|
||||
*/
|
||||
@Deprecated
|
||||
public static WmlPackage getPackage()
|
||||
{
|
||||
return WmlPackage.eINSTANCE;
|
||||
}
|
||||
|
||||
} //WmlFactoryImpl
|
||||
|
|
|
@ -1,421 +1,421 @@
|
|||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
|
||||
*/
|
||||
package org.wesnoth.wml.impl;
|
||||
|
||||
import org.eclipse.emf.ecore.EAttribute;
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.EPackage;
|
||||
import org.eclipse.emf.ecore.EReference;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.EPackageImpl;
|
||||
|
||||
import org.wesnoth.wml.CampaignType;
|
||||
import org.wesnoth.wml.Entity;
|
||||
import org.wesnoth.wml.Import;
|
||||
import org.wesnoth.wml.Model;
|
||||
import org.wesnoth.wml.Property;
|
||||
import org.wesnoth.wml.SimpleType;
|
||||
import org.wesnoth.wml.Type;
|
||||
import org.wesnoth.wml.WmlFactory;
|
||||
import org.wesnoth.wml.WmlPackage;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model <b>Package</b>.
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public class WmlPackageImpl extends EPackageImpl implements WmlPackage
|
||||
{
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass modelEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass importEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass typeEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass simpleTypeEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass campaignTypeEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass entityEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass propertyEClass = null;
|
||||
|
||||
/**
|
||||
* Creates an instance of the model <b>Package</b>, registered with
|
||||
* {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
|
||||
* package URI value.
|
||||
* <p>Note: the correct way to create the package is via the static
|
||||
* factory method {@link #init init()}, which also performs
|
||||
* initialization of the package, or returns the registered package,
|
||||
* if one already exists.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.emf.ecore.EPackage.Registry
|
||||
* @see org.wesnoth.wml.WmlPackage#eNS_URI
|
||||
* @see #init()
|
||||
* @generated
|
||||
*/
|
||||
private WmlPackageImpl()
|
||||
{
|
||||
super(eNS_URI, WmlFactory.eINSTANCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private static boolean isInited = false;
|
||||
|
||||
/**
|
||||
* Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
|
||||
*
|
||||
* <p>This method is used to initialize {@link WmlPackage#eINSTANCE} when that field is accessed.
|
||||
* Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #eNS_URI
|
||||
* @see #createPackageContents()
|
||||
* @see #initializePackageContents()
|
||||
* @generated
|
||||
*/
|
||||
public static WmlPackage init()
|
||||
{
|
||||
if (isInited) return (WmlPackage)EPackage.Registry.INSTANCE.getEPackage(WmlPackage.eNS_URI);
|
||||
|
||||
// Obtain or create and register package
|
||||
WmlPackageImpl theWmlPackage = (WmlPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof WmlPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new WmlPackageImpl());
|
||||
|
||||
isInited = true;
|
||||
|
||||
// Create package meta-data objects
|
||||
theWmlPackage.createPackageContents();
|
||||
|
||||
// Initialize created meta-data
|
||||
theWmlPackage.initializePackageContents();
|
||||
|
||||
// Mark meta-data to indicate it can't be changed
|
||||
theWmlPackage.freeze();
|
||||
|
||||
|
||||
// Update the registry and return the package
|
||||
EPackage.Registry.INSTANCE.put(WmlPackage.eNS_URI, theWmlPackage);
|
||||
return theWmlPackage;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getModel()
|
||||
{
|
||||
return modelEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EReference getModel_Imports()
|
||||
{
|
||||
return (EReference)modelEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EReference getModel_Elements()
|
||||
{
|
||||
return (EReference)modelEClass.getEStructuralFeatures().get(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getImport()
|
||||
{
|
||||
return importEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getImport_ImportURI()
|
||||
{
|
||||
return (EAttribute)importEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getType()
|
||||
{
|
||||
return typeEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getType_Name()
|
||||
{
|
||||
return (EAttribute)typeEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getSimpleType()
|
||||
{
|
||||
return simpleTypeEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getCampaignType()
|
||||
{
|
||||
return campaignTypeEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getEntity()
|
||||
{
|
||||
return entityEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EReference getEntity_Extends()
|
||||
{
|
||||
return (EReference)entityEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EReference getEntity_Properties()
|
||||
{
|
||||
return (EReference)entityEClass.getEStructuralFeatures().get(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getProperty()
|
||||
{
|
||||
return propertyEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getProperty_Name()
|
||||
{
|
||||
return (EAttribute)propertyEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EReference getProperty_Type()
|
||||
{
|
||||
return (EReference)propertyEClass.getEStructuralFeatures().get(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getProperty_Many()
|
||||
{
|
||||
return (EAttribute)propertyEClass.getEStructuralFeatures().get(2);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public WmlFactory getWmlFactory()
|
||||
{
|
||||
return (WmlFactory)getEFactoryInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private boolean isCreated = false;
|
||||
|
||||
/**
|
||||
* Creates the meta-model objects for the package. This method is
|
||||
* guarded to have no affect on any invocation but its first.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void createPackageContents()
|
||||
{
|
||||
if (isCreated) return;
|
||||
isCreated = true;
|
||||
|
||||
// Create classes and their features
|
||||
modelEClass = createEClass(MODEL);
|
||||
createEReference(modelEClass, MODEL__IMPORTS);
|
||||
createEReference(modelEClass, MODEL__ELEMENTS);
|
||||
|
||||
importEClass = createEClass(IMPORT);
|
||||
createEAttribute(importEClass, IMPORT__IMPORT_URI);
|
||||
|
||||
typeEClass = createEClass(TYPE);
|
||||
createEAttribute(typeEClass, TYPE__NAME);
|
||||
|
||||
simpleTypeEClass = createEClass(SIMPLE_TYPE);
|
||||
|
||||
campaignTypeEClass = createEClass(CAMPAIGN_TYPE);
|
||||
|
||||
entityEClass = createEClass(ENTITY);
|
||||
createEReference(entityEClass, ENTITY__EXTENDS);
|
||||
createEReference(entityEClass, ENTITY__PROPERTIES);
|
||||
|
||||
propertyEClass = createEClass(PROPERTY);
|
||||
createEAttribute(propertyEClass, PROPERTY__NAME);
|
||||
createEReference(propertyEClass, PROPERTY__TYPE);
|
||||
createEAttribute(propertyEClass, PROPERTY__MANY);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private boolean isInitialized = false;
|
||||
|
||||
/**
|
||||
* Complete the initialization of the package and its meta-model. This
|
||||
* method is guarded to have no affect on any invocation but its first.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void initializePackageContents()
|
||||
{
|
||||
if (isInitialized) return;
|
||||
isInitialized = true;
|
||||
|
||||
// Initialize package
|
||||
setName(eNAME);
|
||||
setNsPrefix(eNS_PREFIX);
|
||||
setNsURI(eNS_URI);
|
||||
|
||||
// Create type parameters
|
||||
|
||||
// Set bounds for type parameters
|
||||
|
||||
// Add supertypes to classes
|
||||
simpleTypeEClass.getESuperTypes().add(this.getType());
|
||||
campaignTypeEClass.getESuperTypes().add(this.getType());
|
||||
entityEClass.getESuperTypes().add(this.getType());
|
||||
|
||||
// Initialize classes and features; add operations and parameters
|
||||
initEClass(modelEClass, Model.class, "Model", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEReference(getModel_Imports(), this.getImport(), null, "imports", null, 0, -1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEReference(getModel_Elements(), this.getType(), null, "elements", null, 0, -1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(importEClass, Import.class, "Import", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEAttribute(getImport_ImportURI(), ecorePackage.getEString(), "importURI", null, 0, 1, Import.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(typeEClass, Type.class, "Type", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEAttribute(getType_Name(), ecorePackage.getEString(), "name", null, 0, 1, Type.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(simpleTypeEClass, SimpleType.class, "SimpleType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
|
||||
initEClass(campaignTypeEClass, CampaignType.class, "CampaignType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
|
||||
initEClass(entityEClass, Entity.class, "Entity", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEReference(getEntity_Extends(), this.getEntity(), null, "extends", null, 0, 1, Entity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEReference(getEntity_Properties(), this.getProperty(), null, "properties", null, 0, -1, Entity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(propertyEClass, Property.class, "Property", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEAttribute(getProperty_Name(), ecorePackage.getEString(), "name", null, 0, 1, Property.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEReference(getProperty_Type(), this.getType(), null, "type", null, 0, 1, Property.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEAttribute(getProperty_Many(), ecorePackage.getEBoolean(), "many", null, 0, 1, Property.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
// Create resource
|
||||
createResource(eNS_URI);
|
||||
}
|
||||
|
||||
} //WmlPackageImpl
|
||||
*/
|
||||
package org.wesnoth.wml.impl;
|
||||
|
||||
import org.eclipse.emf.ecore.EAttribute;
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.EPackage;
|
||||
import org.eclipse.emf.ecore.EReference;
|
||||
|
||||
import org.eclipse.emf.ecore.impl.EPackageImpl;
|
||||
|
||||
import org.wesnoth.wml.CampaignType;
|
||||
import org.wesnoth.wml.Entity;
|
||||
import org.wesnoth.wml.Import;
|
||||
import org.wesnoth.wml.Model;
|
||||
import org.wesnoth.wml.Property;
|
||||
import org.wesnoth.wml.SimpleType;
|
||||
import org.wesnoth.wml.Type;
|
||||
import org.wesnoth.wml.WmlFactory;
|
||||
import org.wesnoth.wml.WmlPackage;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* An implementation of the model <b>Package</b>.
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public class WmlPackageImpl extends EPackageImpl implements WmlPackage
|
||||
{
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass modelEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass importEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass typeEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass simpleTypeEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass campaignTypeEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass entityEClass = null;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private EClass propertyEClass = null;
|
||||
|
||||
/**
|
||||
* Creates an instance of the model <b>Package</b>, registered with
|
||||
* {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
|
||||
* package URI value.
|
||||
* <p>Note: the correct way to create the package is via the static
|
||||
* factory method {@link #init init()}, which also performs
|
||||
* initialization of the package, or returns the registered package,
|
||||
* if one already exists.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.eclipse.emf.ecore.EPackage.Registry
|
||||
* @see org.wesnoth.wml.WmlPackage#eNS_URI
|
||||
* @see #init()
|
||||
* @generated
|
||||
*/
|
||||
private WmlPackageImpl()
|
||||
{
|
||||
super(eNS_URI, WmlFactory.eINSTANCE);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private static boolean isInited = false;
|
||||
|
||||
/**
|
||||
* Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
|
||||
*
|
||||
* <p>This method is used to initialize {@link WmlPackage#eINSTANCE} when that field is accessed.
|
||||
* Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @see #eNS_URI
|
||||
* @see #createPackageContents()
|
||||
* @see #initializePackageContents()
|
||||
* @generated
|
||||
*/
|
||||
public static WmlPackage init()
|
||||
{
|
||||
if (isInited) return (WmlPackage)EPackage.Registry.INSTANCE.getEPackage(WmlPackage.eNS_URI);
|
||||
|
||||
// Obtain or create and register package
|
||||
WmlPackageImpl theWmlPackage = (WmlPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof WmlPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new WmlPackageImpl());
|
||||
|
||||
isInited = true;
|
||||
|
||||
// Create package meta-data objects
|
||||
theWmlPackage.createPackageContents();
|
||||
|
||||
// Initialize created meta-data
|
||||
theWmlPackage.initializePackageContents();
|
||||
|
||||
// Mark meta-data to indicate it can't be changed
|
||||
theWmlPackage.freeze();
|
||||
|
||||
|
||||
// Update the registry and return the package
|
||||
EPackage.Registry.INSTANCE.put(WmlPackage.eNS_URI, theWmlPackage);
|
||||
return theWmlPackage;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getModel()
|
||||
{
|
||||
return modelEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EReference getModel_Imports()
|
||||
{
|
||||
return (EReference)modelEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EReference getModel_Elements()
|
||||
{
|
||||
return (EReference)modelEClass.getEStructuralFeatures().get(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getImport()
|
||||
{
|
||||
return importEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getImport_ImportURI()
|
||||
{
|
||||
return (EAttribute)importEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getType()
|
||||
{
|
||||
return typeEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getType_Name()
|
||||
{
|
||||
return (EAttribute)typeEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getSimpleType()
|
||||
{
|
||||
return simpleTypeEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getCampaignType()
|
||||
{
|
||||
return campaignTypeEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getEntity()
|
||||
{
|
||||
return entityEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EReference getEntity_Extends()
|
||||
{
|
||||
return (EReference)entityEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EReference getEntity_Properties()
|
||||
{
|
||||
return (EReference)entityEClass.getEStructuralFeatures().get(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EClass getProperty()
|
||||
{
|
||||
return propertyEClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getProperty_Name()
|
||||
{
|
||||
return (EAttribute)propertyEClass.getEStructuralFeatures().get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EReference getProperty_Type()
|
||||
{
|
||||
return (EReference)propertyEClass.getEStructuralFeatures().get(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EAttribute getProperty_Many()
|
||||
{
|
||||
return (EAttribute)propertyEClass.getEStructuralFeatures().get(2);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public WmlFactory getWmlFactory()
|
||||
{
|
||||
return (WmlFactory)getEFactoryInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private boolean isCreated = false;
|
||||
|
||||
/**
|
||||
* Creates the meta-model objects for the package. This method is
|
||||
* guarded to have no affect on any invocation but its first.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void createPackageContents()
|
||||
{
|
||||
if (isCreated) return;
|
||||
isCreated = true;
|
||||
|
||||
// Create classes and their features
|
||||
modelEClass = createEClass(MODEL);
|
||||
createEReference(modelEClass, MODEL__IMPORTS);
|
||||
createEReference(modelEClass, MODEL__ELEMENTS);
|
||||
|
||||
importEClass = createEClass(IMPORT);
|
||||
createEAttribute(importEClass, IMPORT__IMPORT_URI);
|
||||
|
||||
typeEClass = createEClass(TYPE);
|
||||
createEAttribute(typeEClass, TYPE__NAME);
|
||||
|
||||
simpleTypeEClass = createEClass(SIMPLE_TYPE);
|
||||
|
||||
campaignTypeEClass = createEClass(CAMPAIGN_TYPE);
|
||||
|
||||
entityEClass = createEClass(ENTITY);
|
||||
createEReference(entityEClass, ENTITY__EXTENDS);
|
||||
createEReference(entityEClass, ENTITY__PROPERTIES);
|
||||
|
||||
propertyEClass = createEClass(PROPERTY);
|
||||
createEAttribute(propertyEClass, PROPERTY__NAME);
|
||||
createEReference(propertyEClass, PROPERTY__TYPE);
|
||||
createEAttribute(propertyEClass, PROPERTY__MANY);
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
private boolean isInitialized = false;
|
||||
|
||||
/**
|
||||
* Complete the initialization of the package and its meta-model. This
|
||||
* method is guarded to have no affect on any invocation but its first.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public void initializePackageContents()
|
||||
{
|
||||
if (isInitialized) return;
|
||||
isInitialized = true;
|
||||
|
||||
// Initialize package
|
||||
setName(eNAME);
|
||||
setNsPrefix(eNS_PREFIX);
|
||||
setNsURI(eNS_URI);
|
||||
|
||||
// Create type parameters
|
||||
|
||||
// Set bounds for type parameters
|
||||
|
||||
// Add supertypes to classes
|
||||
simpleTypeEClass.getESuperTypes().add(this.getType());
|
||||
campaignTypeEClass.getESuperTypes().add(this.getType());
|
||||
entityEClass.getESuperTypes().add(this.getType());
|
||||
|
||||
// Initialize classes and features; add operations and parameters
|
||||
initEClass(modelEClass, Model.class, "Model", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEReference(getModel_Imports(), this.getImport(), null, "imports", null, 0, -1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEReference(getModel_Elements(), this.getType(), null, "elements", null, 0, -1, Model.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(importEClass, Import.class, "Import", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEAttribute(getImport_ImportURI(), ecorePackage.getEString(), "importURI", null, 0, 1, Import.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(typeEClass, Type.class, "Type", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEAttribute(getType_Name(), ecorePackage.getEString(), "name", null, 0, 1, Type.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(simpleTypeEClass, SimpleType.class, "SimpleType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
|
||||
initEClass(campaignTypeEClass, CampaignType.class, "CampaignType", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
|
||||
initEClass(entityEClass, Entity.class, "Entity", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEReference(getEntity_Extends(), this.getEntity(), null, "extends", null, 0, 1, Entity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEReference(getEntity_Properties(), this.getProperty(), null, "properties", null, 0, -1, Entity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
initEClass(propertyEClass, Property.class, "Property", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEAttribute(getProperty_Name(), ecorePackage.getEString(), "name", null, 0, 1, Property.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEReference(getProperty_Type(), this.getType(), null, "type", null, 0, 1, Property.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEAttribute(getProperty_Many(), ecorePackage.getEBoolean(), "many", null, 0, 1, Property.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
// Create resource
|
||||
createResource(eNS_URI);
|
||||
}
|
||||
|
||||
} //WmlPackageImpl
|
||||
|
|
|
@ -1,256 +1,256 @@
|
|||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
|
||||
*/
|
||||
package org.wesnoth.wml.util;
|
||||
|
||||
import org.eclipse.emf.common.notify.Adapter;
|
||||
import org.eclipse.emf.common.notify.Notifier;
|
||||
|
||||
import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
|
||||
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
|
||||
import org.wesnoth.wml.*;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* The <b>Adapter Factory</b> for the model.
|
||||
* It provides an adapter <code>createXXX</code> method for each class of the model.
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.wesnoth.wml.WmlPackage
|
||||
* @generated
|
||||
*/
|
||||
public class WmlAdapterFactory extends AdapterFactoryImpl
|
||||
{
|
||||
/**
|
||||
* The cached model package.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected static WmlPackage modelPackage;
|
||||
|
||||
/**
|
||||
* Creates an instance of the adapter factory.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public WmlAdapterFactory()
|
||||
{
|
||||
if (modelPackage == null)
|
||||
{
|
||||
modelPackage = WmlPackage.eINSTANCE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether this factory is applicable for the type of the object.
|
||||
* <!-- begin-user-doc -->
|
||||
* This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
|
||||
* <!-- end-user-doc -->
|
||||
* @return whether this factory is applicable for the type of the object.
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean isFactoryForType(Object object)
|
||||
{
|
||||
if (object == modelPackage)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (object instanceof EObject)
|
||||
{
|
||||
return ((EObject)object).eClass().getEPackage() == modelPackage;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* The switch that delegates to the <code>createXXX</code> methods.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected WmlSwitch<Adapter> modelSwitch =
|
||||
new WmlSwitch<Adapter>()
|
||||
{
|
||||
@Override
|
||||
public Adapter caseModel(Model object)
|
||||
{
|
||||
return createModelAdapter();
|
||||
}
|
||||
@Override
|
||||
public Adapter caseImport(Import object)
|
||||
{
|
||||
return createImportAdapter();
|
||||
}
|
||||
@Override
|
||||
public Adapter caseType(Type object)
|
||||
{
|
||||
return createTypeAdapter();
|
||||
}
|
||||
@Override
|
||||
public Adapter caseSimpleType(SimpleType object)
|
||||
{
|
||||
return createSimpleTypeAdapter();
|
||||
}
|
||||
@Override
|
||||
public Adapter caseCampaignType(CampaignType object)
|
||||
{
|
||||
return createCampaignTypeAdapter();
|
||||
}
|
||||
@Override
|
||||
public Adapter caseEntity(Entity object)
|
||||
{
|
||||
return createEntityAdapter();
|
||||
}
|
||||
@Override
|
||||
public Adapter caseProperty(Property object)
|
||||
{
|
||||
return createPropertyAdapter();
|
||||
}
|
||||
@Override
|
||||
public Adapter defaultCase(EObject object)
|
||||
{
|
||||
return createEObjectAdapter();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates an adapter for the <code>target</code>.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param target the object to adapt.
|
||||
* @return the adapter for the <code>target</code>.
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Adapter createAdapter(Notifier target)
|
||||
{
|
||||
return modelSwitch.doSwitch((EObject)target);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link org.wesnoth.wml.Model <em>Model</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This default implementation returns null so that we can easily ignore cases;
|
||||
* it's useful to ignore a case when inheritance will catch all the cases anyway.
|
||||
* <!-- end-user-doc -->
|
||||
* @return the new adapter.
|
||||
* @see org.wesnoth.wml.Model
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createModelAdapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link org.wesnoth.wml.Import <em>Import</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This default implementation returns null so that we can easily ignore cases;
|
||||
* it's useful to ignore a case when inheritance will catch all the cases anyway.
|
||||
* <!-- end-user-doc -->
|
||||
* @return the new adapter.
|
||||
* @see org.wesnoth.wml.Import
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createImportAdapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link org.wesnoth.wml.Type <em>Type</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This default implementation returns null so that we can easily ignore cases;
|
||||
* it's useful to ignore a case when inheritance will catch all the cases anyway.
|
||||
* <!-- end-user-doc -->
|
||||
* @return the new adapter.
|
||||
* @see org.wesnoth.wml.Type
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createTypeAdapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link org.wesnoth.wml.SimpleType <em>Simple Type</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This default implementation returns null so that we can easily ignore cases;
|
||||
* it's useful to ignore a case when inheritance will catch all the cases anyway.
|
||||
* <!-- end-user-doc -->
|
||||
* @return the new adapter.
|
||||
* @see org.wesnoth.wml.SimpleType
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createSimpleTypeAdapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link org.wesnoth.wml.CampaignType <em>Campaign Type</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This default implementation returns null so that we can easily ignore cases;
|
||||
* it's useful to ignore a case when inheritance will catch all the cases anyway.
|
||||
* <!-- end-user-doc -->
|
||||
* @return the new adapter.
|
||||
* @see org.wesnoth.wml.CampaignType
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createCampaignTypeAdapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link org.wesnoth.wml.Entity <em>Entity</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This default implementation returns null so that we can easily ignore cases;
|
||||
* it's useful to ignore a case when inheritance will catch all the cases anyway.
|
||||
* <!-- end-user-doc -->
|
||||
* @return the new adapter.
|
||||
* @see org.wesnoth.wml.Entity
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createEntityAdapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link org.wesnoth.wml.Property <em>Property</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This default implementation returns null so that we can easily ignore cases;
|
||||
* it's useful to ignore a case when inheritance will catch all the cases anyway.
|
||||
* <!-- end-user-doc -->
|
||||
* @return the new adapter.
|
||||
* @see org.wesnoth.wml.Property
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createPropertyAdapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for the default case.
|
||||
* <!-- begin-user-doc -->
|
||||
* This default implementation returns null.
|
||||
* <!-- end-user-doc -->
|
||||
* @return the new adapter.
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createEObjectAdapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
} //WmlAdapterFactory
|
||||
*/
|
||||
package org.wesnoth.wml.util;
|
||||
|
||||
import org.eclipse.emf.common.notify.Adapter;
|
||||
import org.eclipse.emf.common.notify.Notifier;
|
||||
|
||||
import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
|
||||
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
|
||||
import org.wesnoth.wml.*;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* The <b>Adapter Factory</b> for the model.
|
||||
* It provides an adapter <code>createXXX</code> method for each class of the model.
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.wesnoth.wml.WmlPackage
|
||||
* @generated
|
||||
*/
|
||||
public class WmlAdapterFactory extends AdapterFactoryImpl
|
||||
{
|
||||
/**
|
||||
* The cached model package.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected static WmlPackage modelPackage;
|
||||
|
||||
/**
|
||||
* Creates an instance of the adapter factory.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public WmlAdapterFactory()
|
||||
{
|
||||
if (modelPackage == null)
|
||||
{
|
||||
modelPackage = WmlPackage.eINSTANCE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether this factory is applicable for the type of the object.
|
||||
* <!-- begin-user-doc -->
|
||||
* This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
|
||||
* <!-- end-user-doc -->
|
||||
* @return whether this factory is applicable for the type of the object.
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public boolean isFactoryForType(Object object)
|
||||
{
|
||||
if (object == modelPackage)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (object instanceof EObject)
|
||||
{
|
||||
return ((EObject)object).eClass().getEPackage() == modelPackage;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* The switch that delegates to the <code>createXXX</code> methods.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected WmlSwitch<Adapter> modelSwitch =
|
||||
new WmlSwitch<Adapter>()
|
||||
{
|
||||
@Override
|
||||
public Adapter caseModel(Model object)
|
||||
{
|
||||
return createModelAdapter();
|
||||
}
|
||||
@Override
|
||||
public Adapter caseImport(Import object)
|
||||
{
|
||||
return createImportAdapter();
|
||||
}
|
||||
@Override
|
||||
public Adapter caseType(Type object)
|
||||
{
|
||||
return createTypeAdapter();
|
||||
}
|
||||
@Override
|
||||
public Adapter caseSimpleType(SimpleType object)
|
||||
{
|
||||
return createSimpleTypeAdapter();
|
||||
}
|
||||
@Override
|
||||
public Adapter caseCampaignType(CampaignType object)
|
||||
{
|
||||
return createCampaignTypeAdapter();
|
||||
}
|
||||
@Override
|
||||
public Adapter caseEntity(Entity object)
|
||||
{
|
||||
return createEntityAdapter();
|
||||
}
|
||||
@Override
|
||||
public Adapter caseProperty(Property object)
|
||||
{
|
||||
return createPropertyAdapter();
|
||||
}
|
||||
@Override
|
||||
public Adapter defaultCase(EObject object)
|
||||
{
|
||||
return createEObjectAdapter();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates an adapter for the <code>target</code>.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @param target the object to adapt.
|
||||
* @return the adapter for the <code>target</code>.
|
||||
* @generated
|
||||
*/
|
||||
@Override
|
||||
public Adapter createAdapter(Notifier target)
|
||||
{
|
||||
return modelSwitch.doSwitch((EObject)target);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link org.wesnoth.wml.Model <em>Model</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This default implementation returns null so that we can easily ignore cases;
|
||||
* it's useful to ignore a case when inheritance will catch all the cases anyway.
|
||||
* <!-- end-user-doc -->
|
||||
* @return the new adapter.
|
||||
* @see org.wesnoth.wml.Model
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createModelAdapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link org.wesnoth.wml.Import <em>Import</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This default implementation returns null so that we can easily ignore cases;
|
||||
* it's useful to ignore a case when inheritance will catch all the cases anyway.
|
||||
* <!-- end-user-doc -->
|
||||
* @return the new adapter.
|
||||
* @see org.wesnoth.wml.Import
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createImportAdapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link org.wesnoth.wml.Type <em>Type</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This default implementation returns null so that we can easily ignore cases;
|
||||
* it's useful to ignore a case when inheritance will catch all the cases anyway.
|
||||
* <!-- end-user-doc -->
|
||||
* @return the new adapter.
|
||||
* @see org.wesnoth.wml.Type
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createTypeAdapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link org.wesnoth.wml.SimpleType <em>Simple Type</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This default implementation returns null so that we can easily ignore cases;
|
||||
* it's useful to ignore a case when inheritance will catch all the cases anyway.
|
||||
* <!-- end-user-doc -->
|
||||
* @return the new adapter.
|
||||
* @see org.wesnoth.wml.SimpleType
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createSimpleTypeAdapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link org.wesnoth.wml.CampaignType <em>Campaign Type</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This default implementation returns null so that we can easily ignore cases;
|
||||
* it's useful to ignore a case when inheritance will catch all the cases anyway.
|
||||
* <!-- end-user-doc -->
|
||||
* @return the new adapter.
|
||||
* @see org.wesnoth.wml.CampaignType
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createCampaignTypeAdapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link org.wesnoth.wml.Entity <em>Entity</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This default implementation returns null so that we can easily ignore cases;
|
||||
* it's useful to ignore a case when inheritance will catch all the cases anyway.
|
||||
* <!-- end-user-doc -->
|
||||
* @return the new adapter.
|
||||
* @see org.wesnoth.wml.Entity
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createEntityAdapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for an object of class '{@link org.wesnoth.wml.Property <em>Property</em>}'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This default implementation returns null so that we can easily ignore cases;
|
||||
* it's useful to ignore a case when inheritance will catch all the cases anyway.
|
||||
* <!-- end-user-doc -->
|
||||
* @return the new adapter.
|
||||
* @see org.wesnoth.wml.Property
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createPropertyAdapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new adapter for the default case.
|
||||
* <!-- begin-user-doc -->
|
||||
* This default implementation returns null.
|
||||
* <!-- end-user-doc -->
|
||||
* @return the new adapter.
|
||||
* @generated
|
||||
*/
|
||||
public Adapter createEObjectAdapter()
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
} //WmlAdapterFactory
|
||||
|
|
|
@ -1,283 +1,283 @@
|
|||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
/**
|
||||
* <copyright>
|
||||
* </copyright>
|
||||
*
|
||||
|
||||
*/
|
||||
package org.wesnoth.wml.util;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
|
||||
import org.wesnoth.wml.*;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* The <b>Switch</b> for the model's inheritance hierarchy.
|
||||
* It supports the call {@link #doSwitch(EObject) doSwitch(object)}
|
||||
* to invoke the <code>caseXXX</code> method for each class of the model,
|
||||
* starting with the actual class of the object
|
||||
* and proceeding up the inheritance hierarchy
|
||||
* until a non-null result is returned,
|
||||
* which is the result of the switch.
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.wesnoth.wml.WmlPackage
|
||||
* @generated
|
||||
*/
|
||||
public class WmlSwitch<T>
|
||||
{
|
||||
/**
|
||||
* The cached model package
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected static WmlPackage modelPackage;
|
||||
|
||||
/**
|
||||
* Creates an instance of the switch.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public WmlSwitch()
|
||||
{
|
||||
if (modelPackage == null)
|
||||
{
|
||||
modelPackage = WmlPackage.eINSTANCE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the first non-null result returned by a <code>caseXXX</code> call.
|
||||
* @generated
|
||||
*/
|
||||
public T doSwitch(EObject theEObject)
|
||||
{
|
||||
return doSwitch(theEObject.eClass(), theEObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the first non-null result returned by a <code>caseXXX</code> call.
|
||||
* @generated
|
||||
*/
|
||||
protected T doSwitch(EClass theEClass, EObject theEObject)
|
||||
{
|
||||
if (theEClass.eContainer() == modelPackage)
|
||||
{
|
||||
return doSwitch(theEClass.getClassifierID(), theEObject);
|
||||
}
|
||||
else
|
||||
{
|
||||
List<EClass> eSuperTypes = theEClass.getESuperTypes();
|
||||
return
|
||||
eSuperTypes.isEmpty() ?
|
||||
defaultCase(theEObject) :
|
||||
doSwitch(eSuperTypes.get(0), theEObject);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the first non-null result returned by a <code>caseXXX</code> call.
|
||||
* @generated
|
||||
*/
|
||||
protected T doSwitch(int classifierID, EObject theEObject)
|
||||
{
|
||||
switch (classifierID)
|
||||
{
|
||||
case WmlPackage.MODEL:
|
||||
{
|
||||
Model model = (Model)theEObject;
|
||||
T result = caseModel(model);
|
||||
if (result == null) result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
case WmlPackage.IMPORT:
|
||||
{
|
||||
Import import_ = (Import)theEObject;
|
||||
T result = caseImport(import_);
|
||||
if (result == null) result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
case WmlPackage.TYPE:
|
||||
{
|
||||
Type type = (Type)theEObject;
|
||||
T result = caseType(type);
|
||||
if (result == null) result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
case WmlPackage.SIMPLE_TYPE:
|
||||
{
|
||||
SimpleType simpleType = (SimpleType)theEObject;
|
||||
T result = caseSimpleType(simpleType);
|
||||
if (result == null) result = caseType(simpleType);
|
||||
if (result == null) result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
case WmlPackage.CAMPAIGN_TYPE:
|
||||
{
|
||||
CampaignType campaignType = (CampaignType)theEObject;
|
||||
T result = caseCampaignType(campaignType);
|
||||
if (result == null) result = caseType(campaignType);
|
||||
if (result == null) result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
case WmlPackage.ENTITY:
|
||||
{
|
||||
Entity entity = (Entity)theEObject;
|
||||
T result = caseEntity(entity);
|
||||
if (result == null) result = caseType(entity);
|
||||
if (result == null) result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
case WmlPackage.PROPERTY:
|
||||
{
|
||||
Property property = (Property)theEObject;
|
||||
T result = caseProperty(property);
|
||||
if (result == null) result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
default: return defaultCase(theEObject);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Model</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This implementation returns null;
|
||||
* returning a non-null result will terminate the switch.
|
||||
* <!-- end-user-doc -->
|
||||
* @param object the target of the switch.
|
||||
* @return the result of interpreting the object as an instance of '<em>Model</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseModel(Model object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Import</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This implementation returns null;
|
||||
* returning a non-null result will terminate the switch.
|
||||
* <!-- end-user-doc -->
|
||||
* @param object the target of the switch.
|
||||
* @return the result of interpreting the object as an instance of '<em>Import</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseImport(Import object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Type</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This implementation returns null;
|
||||
* returning a non-null result will terminate the switch.
|
||||
* <!-- end-user-doc -->
|
||||
* @param object the target of the switch.
|
||||
* @return the result of interpreting the object as an instance of '<em>Type</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseType(Type object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Simple Type</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This implementation returns null;
|
||||
* returning a non-null result will terminate the switch.
|
||||
* <!-- end-user-doc -->
|
||||
* @param object the target of the switch.
|
||||
* @return the result of interpreting the object as an instance of '<em>Simple Type</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseSimpleType(SimpleType object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Campaign Type</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This implementation returns null;
|
||||
* returning a non-null result will terminate the switch.
|
||||
* <!-- end-user-doc -->
|
||||
* @param object the target of the switch.
|
||||
* @return the result of interpreting the object as an instance of '<em>Campaign Type</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseCampaignType(CampaignType object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Entity</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This implementation returns null;
|
||||
* returning a non-null result will terminate the switch.
|
||||
* <!-- end-user-doc -->
|
||||
* @param object the target of the switch.
|
||||
* @return the result of interpreting the object as an instance of '<em>Entity</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseEntity(Entity object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Property</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This implementation returns null;
|
||||
* returning a non-null result will terminate the switch.
|
||||
* <!-- end-user-doc -->
|
||||
* @param object the target of the switch.
|
||||
* @return the result of interpreting the object as an instance of '<em>Property</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseProperty(Property object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This implementation returns null;
|
||||
* returning a non-null result will terminate the switch, but this is the last case anyway.
|
||||
* <!-- end-user-doc -->
|
||||
* @param object the target of the switch.
|
||||
* @return the result of interpreting the object as an instance of '<em>EObject</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T defaultCase(EObject object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
} //WmlSwitch
|
||||
*/
|
||||
package org.wesnoth.wml.util;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
|
||||
import org.wesnoth.wml.*;
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* The <b>Switch</b> for the model's inheritance hierarchy.
|
||||
* It supports the call {@link #doSwitch(EObject) doSwitch(object)}
|
||||
* to invoke the <code>caseXXX</code> method for each class of the model,
|
||||
* starting with the actual class of the object
|
||||
* and proceeding up the inheritance hierarchy
|
||||
* until a non-null result is returned,
|
||||
* which is the result of the switch.
|
||||
* <!-- end-user-doc -->
|
||||
* @see org.wesnoth.wml.WmlPackage
|
||||
* @generated
|
||||
*/
|
||||
public class WmlSwitch<T>
|
||||
{
|
||||
/**
|
||||
* The cached model package
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
protected static WmlPackage modelPackage;
|
||||
|
||||
/**
|
||||
* Creates an instance of the switch.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public WmlSwitch()
|
||||
{
|
||||
if (modelPackage == null)
|
||||
{
|
||||
modelPackage = WmlPackage.eINSTANCE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the first non-null result returned by a <code>caseXXX</code> call.
|
||||
* @generated
|
||||
*/
|
||||
public T doSwitch(EObject theEObject)
|
||||
{
|
||||
return doSwitch(theEObject.eClass(), theEObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the first non-null result returned by a <code>caseXXX</code> call.
|
||||
* @generated
|
||||
*/
|
||||
protected T doSwitch(EClass theEClass, EObject theEObject)
|
||||
{
|
||||
if (theEClass.eContainer() == modelPackage)
|
||||
{
|
||||
return doSwitch(theEClass.getClassifierID(), theEObject);
|
||||
}
|
||||
else
|
||||
{
|
||||
List<EClass> eSuperTypes = theEClass.getESuperTypes();
|
||||
return
|
||||
eSuperTypes.isEmpty() ?
|
||||
defaultCase(theEObject) :
|
||||
doSwitch(eSuperTypes.get(0), theEObject);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @return the first non-null result returned by a <code>caseXXX</code> call.
|
||||
* @generated
|
||||
*/
|
||||
protected T doSwitch(int classifierID, EObject theEObject)
|
||||
{
|
||||
switch (classifierID)
|
||||
{
|
||||
case WmlPackage.MODEL:
|
||||
{
|
||||
Model model = (Model)theEObject;
|
||||
T result = caseModel(model);
|
||||
if (result == null) result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
case WmlPackage.IMPORT:
|
||||
{
|
||||
Import import_ = (Import)theEObject;
|
||||
T result = caseImport(import_);
|
||||
if (result == null) result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
case WmlPackage.TYPE:
|
||||
{
|
||||
Type type = (Type)theEObject;
|
||||
T result = caseType(type);
|
||||
if (result == null) result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
case WmlPackage.SIMPLE_TYPE:
|
||||
{
|
||||
SimpleType simpleType = (SimpleType)theEObject;
|
||||
T result = caseSimpleType(simpleType);
|
||||
if (result == null) result = caseType(simpleType);
|
||||
if (result == null) result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
case WmlPackage.CAMPAIGN_TYPE:
|
||||
{
|
||||
CampaignType campaignType = (CampaignType)theEObject;
|
||||
T result = caseCampaignType(campaignType);
|
||||
if (result == null) result = caseType(campaignType);
|
||||
if (result == null) result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
case WmlPackage.ENTITY:
|
||||
{
|
||||
Entity entity = (Entity)theEObject;
|
||||
T result = caseEntity(entity);
|
||||
if (result == null) result = caseType(entity);
|
||||
if (result == null) result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
case WmlPackage.PROPERTY:
|
||||
{
|
||||
Property property = (Property)theEObject;
|
||||
T result = caseProperty(property);
|
||||
if (result == null) result = defaultCase(theEObject);
|
||||
return result;
|
||||
}
|
||||
default: return defaultCase(theEObject);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Model</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This implementation returns null;
|
||||
* returning a non-null result will terminate the switch.
|
||||
* <!-- end-user-doc -->
|
||||
* @param object the target of the switch.
|
||||
* @return the result of interpreting the object as an instance of '<em>Model</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseModel(Model object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Import</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This implementation returns null;
|
||||
* returning a non-null result will terminate the switch.
|
||||
* <!-- end-user-doc -->
|
||||
* @param object the target of the switch.
|
||||
* @return the result of interpreting the object as an instance of '<em>Import</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseImport(Import object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Type</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This implementation returns null;
|
||||
* returning a non-null result will terminate the switch.
|
||||
* <!-- end-user-doc -->
|
||||
* @param object the target of the switch.
|
||||
* @return the result of interpreting the object as an instance of '<em>Type</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseType(Type object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Simple Type</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This implementation returns null;
|
||||
* returning a non-null result will terminate the switch.
|
||||
* <!-- end-user-doc -->
|
||||
* @param object the target of the switch.
|
||||
* @return the result of interpreting the object as an instance of '<em>Simple Type</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseSimpleType(SimpleType object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Campaign Type</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This implementation returns null;
|
||||
* returning a non-null result will terminate the switch.
|
||||
* <!-- end-user-doc -->
|
||||
* @param object the target of the switch.
|
||||
* @return the result of interpreting the object as an instance of '<em>Campaign Type</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseCampaignType(CampaignType object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Entity</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This implementation returns null;
|
||||
* returning a non-null result will terminate the switch.
|
||||
* <!-- end-user-doc -->
|
||||
* @param object the target of the switch.
|
||||
* @return the result of interpreting the object as an instance of '<em>Entity</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseEntity(Entity object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>Property</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This implementation returns null;
|
||||
* returning a non-null result will terminate the switch.
|
||||
* <!-- end-user-doc -->
|
||||
* @param object the target of the switch.
|
||||
* @return the result of interpreting the object as an instance of '<em>Property</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T caseProperty(Property object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
|
||||
* <!-- begin-user-doc -->
|
||||
* This implementation returns null;
|
||||
* returning a non-null result will terminate the switch, but this is the last case anyway.
|
||||
* <!-- end-user-doc -->
|
||||
* @param object the target of the switch.
|
||||
* @return the result of interpreting the object as an instance of '<em>EObject</em>'.
|
||||
* @see #doSwitch(org.eclipse.emf.ecore.EObject)
|
||||
* @generated
|
||||
*/
|
||||
public T defaultCase(EObject object)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
} //WmlSwitch
|
||||
|
|
Loading…
Add table
Reference in a new issue