1 /******************************************************************
\r
3 * Copyright 2015 Samsung Electronics All Rights Reserved.
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
19 ******************************************************************/
\r
27 #include "UriParameter.h"
\r
28 #include "ActionType.h"
\r
31 #include "IncludeResolver.h"
\r
38 virtual std::string getDisplayName() const;
\r
39 virtual void setDisplayName(const std::string &displayName);
\r
41 virtual std::string getDescription() const;
\r
42 virtual void setDescription(const std::string &description);
\r
44 virtual std::string getParentUri() const;
\r
45 virtual void setParentUri(const std::string &parentUri);
\r
47 virtual std::string getRelativeUri() const;
\r
48 virtual void setRelativeUri(const std::string &relativeUri);
\r
50 virtual std::map<std::string, UriParameterPtr> const &getUriParameters() const;
\r
51 virtual void setUriParameter(const std::string ¶mName, const UriParameterPtr &uriParameter);
\r
53 virtual std::map<std::string, UriParameterPtr > const &getBaseUriParameters() const;
\r
54 virtual void setBaseUriParameter(const std::string ¶mName,
\r
55 const UriParameterPtr &baseUriParameter);
\r
57 virtual ActionPtr getAction(ActionType actionType);
\r
58 virtual std::map<ActionType , ActionPtr> const &getActions() const;
\r
59 virtual void setAction(const ActionType &actiontype , const ActionPtr &action );
\r
61 virtual std::map<std::string, std::shared_ptr<RamlResource> > const &getResources() const;
\r
62 virtual void setResource(const std::string &resourceName,
\r
63 const std::shared_ptr<RamlResource> &resources);
\r
65 virtual std::list<std::string> const &getTraits() const;
\r
66 virtual void setTrait(const std::string &trait);
\r
68 virtual std::string getResourceType() const;
\r
69 virtual void setResourceType(const std::string &type);
\r
71 virtual std::string getResourceUri() const;
\r
72 RamlResource(): m_includeResolver(NULL) {}
\r
73 RamlResource(const std::string resourceKey, const YAML::Node &yamlNode ,
\r
74 const IncludeResolverPtr &includeResolver,
\r
75 const std::string &parentUri) : m_includeResolver(includeResolver)
\r
77 readResource(resourceKey, yamlNode, parentUri);
\r
80 void readResource(const std::string resourceKey, const YAML::Node &yamlNode,
\r
81 const std::string &parentUri);
\r
83 std::string m_displayName;
\r
84 std::string m_description;
\r
85 std::string m_relativeUri;
\r
86 std::map<std::string, UriParameterPtr> m_uriParameters;
\r
87 std::map<std::string, UriParameterPtr > m_baseUriParameters;
\r
88 std::map<ActionType , ActionPtr> m_actions;
\r
89 std::list<std::string> m_traits;
\r
90 std::string m_resourceType;
\r
91 std::string m_parentUri;
\r
92 std::map<std::string, std::shared_ptr<RamlResource> > m_resources;
\r
93 IncludeResolverPtr m_includeResolver;
\r
96 typedef std::shared_ptr<RamlResource> RamlResourcePtr;
\r