test_class.declarator: alienContextVariables
test_class.modifier: private
test_class.original_string: private AlienContextVariables alienContextVariables;
test_class.type: AlienContextVariables
test_class.var_name: alienContextVariables
test_class.file: alien4cloud-core/src/test/java/org/alien4cloud/tosca/variable/AlienContextVariablesTest.java
test_class.identifier: AlienContextVariablesTest
test_case.body: @Test
      public void check_tags_can_be_resolved() throws Exception {
          Assertions.assertThat(alienContextVariables.getProperty("a4c.application.tags.yolo")).isEqualTo("oloy");
          Assertions.assertThat(alienContextVariables.getProperty("a4c.application.tags.tagName")).isEqualTo("tagValue");
      }
test_case.class_method_signature: AlienContextVariablesTest.check_tags_can_be_resolved()
test_case.full_signature: @Test public void check_tags_can_be_resolved()
test_case.identifier: check_tags_can_be_resolved
test_case.invocations: isEqualTo assertThat getProperty isEqualTo assertThat getProperty
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void check_tags_can_be_resolved()
focal_class.declarator: application
focal_class.modifier: private
focal_class.original_string: private Application application;
focal_class.type: Application
focal_class.var_name: application
focal_class.declarator: applicationEnvironment
focal_class.modifier: private
focal_class.original_string: private ApplicationEnvironment applicationEnvironment;
focal_class.type: ApplicationEnvironment
focal_class.var_name: applicationEnvironment
focal_class.declarator: location
focal_class.modifier: private
focal_class.original_string: private Location location;
focal_class.type: Location
focal_class.var_name: location
focal_class.file: alien4cloud-core/src/main/java/org/alien4cloud/tosca/variable/AlienContextVariables.java
focal_class.identifier: AlienContextVariables
focal_class.class_method_signature: AlienContextVariables.AlienContextVariables()
focal_class.full_signature: public  AlienContextVariables()
focal_class.identifier: AlienContextVariables
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  AlienContextVariables()
focal_class.class_method_signature: AlienContextVariables.getProperty(String name)
focal_class.full_signature: @Override public Object getProperty(String name)
focal_class.identifier: getProperty
focal_class.modifiers: @Override public
focal_class.parameters: (String name)
focal_class.return: Object
focal_class.signature: Object getProperty(String name)
focal_class.class_method_signature: AlienContextVariables.findMetaProperties(String metaName, IMetaProperties metaProperties)
focal_class.full_signature: private String findMetaProperties(String metaName, IMetaProperties metaProperties)
focal_class.identifier: findMetaProperties
focal_class.modifiers: private
focal_class.parameters: (String metaName, IMetaProperties metaProperties)
focal_class.return: String
focal_class.signature: String findMetaProperties(String metaName, IMetaProperties metaProperties)
focal_class.class_method_signature: AlienContextVariables.ifNotNull(T o, Function<T, R> getter)
focal_class.full_signature: private R ifNotNull(T o, Function<T, R> getter)
focal_class.identifier: ifNotNull
focal_class.modifiers: private
focal_class.parameters: (T o, Function<T, R> getter)
focal_class.return: R
focal_class.signature: R ifNotNull(T o, Function<T, R> getter)
focal_class.superclass: extends PropertySource
focal_method.body: @Override
      public Object getProperty(String name) {
          if (!name.startsWith("a4c.")) {
              return null;
          }
  
          switch (name) {
              case "a4c.application":
                  return application;
  
              case "a4c.application.id":
                  return ifNotNull(application, Application::getId);
  
              case "a4c.application.name":
                  return ifNotNull(application, Application::getName);
  
              case "a4c.environment.type":
                  return ifNotNull(applicationEnvironment, ApplicationEnvironment::getEnvironmentType);
  
              case "a4c.environment.name":
                  return ifNotNull(applicationEnvironment, ApplicationEnvironment::getName);
          }
  
          // lookup for a tag
          if (name.startsWith("a4c.application.tags.")) {
              if (application != null && application.getTags() != null) {
                  String tagName = StringUtils.removeStart(name, "a4c.application.tags.");
  
                  for (Tag tag : application.getTags()) {
                      if (tag.getName().equals(tagName)) {
                          return tag.getValue();
                      }
                  }
              }
          }
  
          // lookup for meta properties
          String metaName = StringUtils.removeStart(name, "a4c.");
          String metaValue = findMetaProperties(metaName, application);
          if (metaValue != null) {
              return metaValue;
          }
          metaValue = findMetaProperties(metaName, location);
          if (metaValue != null) {
              return metaValue;
          }
  
          return null;
      }
focal_method.class_method_signature: AlienContextVariables.getProperty(String name)
focal_method.full_signature: @Override public Object getProperty(String name)
focal_method.identifier: getProperty
focal_method.invocations: startsWith ifNotNull ifNotNull ifNotNull ifNotNull startsWith getTags removeStart getTags equals getName getValue removeStart findMetaProperties findMetaProperties
focal_method.modifiers: @Override public
focal_method.parameters: (String name)
focal_method.return: Object
focal_method.signature: Object getProperty(String name)