Tabnine Logo
BasePropertyCollector
Code IndexAdd Tabnine to your IDE (free)

How to use
BasePropertyCollector
in
ch.puzzle.itc.mobiliar.business.generator.control.extracted.properties

Best Java code snippets using ch.puzzle.itc.mobiliar.business.generator.control.extracted.properties.BasePropertyCollector (Showing top 18 results out of 315)

origin: liimaorg/liima

private void populateProperties() {
  templateFiles = Maps.newLinkedHashMap();
  this.applications = Maps.newLinkedHashMap();
  this.contextProperties = Maps.newTreeMap();
  contextProperties.putAll(new BasePropertyCollector().propertiesForContext(context.getContext()));
}
origin: liimaorg/liima

public Map<String, FreeMarkerProperty> propertiesForContext(final ContextEntity context) {
  Map<String, FreeMarkerProperty> result = translatePropertyList(utils().getPropertyValues(context),
      context.getName(), context.getId(), null, null, null);
  result.put(RESERVED_PROPERTY_DOMAIN, new FreeMarkerProperty(getDomainName(context), RESERVED_PROPERTY_DOMAIN));
  result.put(RESERVED_PROPERTY_NAME_ALIAS, new FreeMarkerProperty(context.getNameAlias(), RESERVED_PROPERTY_NAME_ALIAS));
  return result;
}
origin: liimaorg/liima

protected Map<String, FreeMarkerProperty> propertiesForRelation(final ResourceEntity resource,
    final ContextEntity context,
    final AbstractResourceRelationEntity relation) {
  return translatePropertyList(getPropertiesForRelation(context, relation),
      resource.getName(), resource.getId(), resource.getResourceGroup().getId(), null, null);
}
origin: liimaorg/liima

@Test
public void translatePropertyList_shouldAddAdditionalProperties() {
  // when
  Map<String, FreeMarkerProperty> result = c.translatePropertyList(null,"name", Integer.valueOf(1), Integer.valueOf(2), "release", "outofServiceRel");
  
  // then
  assertNotNull(result);
  assertEquals(5, result.keySet().size());
  assertEquals("name", result.get("name").getCurrentValue());
  assertEquals("1", result.get("id").getCurrentValue());
  assertEquals("2", result.get("resGroupId").getCurrentValue());
  assertEquals("release", result.get("release").getCurrentValue());
  assertEquals("outofServiceRel", result.get("outOfServiceRelease").getCurrentValue());
  
}
origin: liimaorg/liima

public Map<String, FreeMarkerProperty> propertiesForResource(final ResourceEntity resource,
    final ContextEntity context,
    AMWTemplateExceptionHandler templateExceptionHandler) {
  String outOfServiceRelease = resource.getResourceGroup().getOutOfServiceRelease() != null ? resource.getResourceGroup().getOutOfServiceRelease().getName() : null;
  return translatePropertyList(getPropertiesForResource(resource, context, templateExceptionHandler),
      resource.getName(), resource.getId(), resource.getResourceGroup().getId(), resource.getRelease() != null ? resource.getRelease().getName() : null, outOfServiceRelease);
}
origin: liimaorg/liima

@Test
public void propertiesForContext_shouldAddAdditionalProperties() {
  // when
  ContextEntity context = new ContextEntity();
  context.setParent(new ContextEntity());
  context.setName("B");
  context.setNameAlias("Test");
  Map<String, FreeMarkerProperty> props = c.propertiesForContext(context);
  // then
  assertNotNull(props);
  assertEquals(3, props.keySet().size());
  assertEquals(null, props.get("domain").getCurrentValue());
  assertEquals(context.getName(), props.get("name").getCurrentValue());
  assertEquals(context.getNameAlias(), props.get("nameAlias").getCurrentValue());
}
origin: liimaorg/liima

private List<PropertyEntity> getPropertiesForResource(final ResourceEntity applicationServer,
    final ContextEntity context, AMWTemplateExceptionHandler templateExceptionHandler) {
  return utils().getPropertyValues(applicationServer, context, templateExceptionHandler);
}
origin: liimaorg/liima

/**
 * Collects relation Properties, populates typed with types of collected properties.
 * 
 * Populates properties
 *
 * @return properties of resource
 */
private Map<String, FreeMarkerProperty> collectRelationProperties(ContextEntity context, ResourceEntity resource,
    AbstractResourceRelationEntity resourceRelation) {
  return collector.propertiesForRelation(resource, context, resourceRelation);
}
origin: liimaorg/liima

/**
 * Collects resource Properties, populates typed with types of collected properties.
 * 
 * Populates properties
 */
private Map<String, FreeMarkerProperty> collectResourceProperties(ContextEntity context, ResourceEntity resource) {
  return collector.propertiesForResource(resource, context, templateExceptionHandler);
}
origin: liimaorg/liima

public AppServerRelationProperties(ContextEntity context, ResourceEntity owner, AMWTemplateExceptionHandler templateExceptionHandler) {
  this.owner = owner;
  this.context = context;
  this.templateExceptionHandler = templateExceptionHandler;
  this.collector = new BasePropertyCollector();
  this.properties = collectResourceProperties(context, owner);
}
origin: liimaorg/liima

@Test
public void translatePropertyList_shouldNotAddProperty_keyOptionalTrue_and_no_value() {
  // given
  PropertyEntity p = new PropertyEntity();
  PropertyDescriptorEntity d = new PropertyDescriptorEntity();
  d.setOptional(true);
  d.setPropertyName("propName");
  
  p.setDescriptor(d);
  p.setValue("");
  
  List<PropertyEntity> properties = new ArrayList<>();
  properties.add(p);
  
  // when
  Map<String, FreeMarkerProperty> result = c.translatePropertyList(properties , null, null, null, null, null);
  
  // then
  assertNotNull(result);
  assertEquals(0, result.keySet().size());
}

origin: liimaorg/liima

private List<PropertyEntity> getPropertiesForRelation(ContextEntity context,
    AbstractResourceRelationEntity relation) {
  return utils().getPropertyValues(relation, context);
}
origin: liimaorg/liima

@Test
public void translatePropertyList_shouldNotAddProperty_keyOptionalTrue_and_value_null() {
  // given
  PropertyEntity p = new PropertyEntity();
  PropertyDescriptorEntity d = new PropertyDescriptorEntity();
  d.setOptional(true);
  d.setPropertyName("propName");
  
  p.setDescriptor(d);
  p.setValue(null);
  
  List<PropertyEntity> properties = new ArrayList<>();
  properties.add(p);
  
  // when
  Map<String, FreeMarkerProperty> result = c.translatePropertyList(properties , null, null, null, null, null);
  
  // then
  assertNotNull(result);
  assertEquals(0, result.keySet().size());
}

origin: liimaorg/liima

@Test
public void translatePropertyList_shouldNotAddProperty_keyOptionalTrue_and_no_value_but_default() {
  // given
  PropertyEntity p = new PropertyEntity();
  PropertyDescriptorEntity d = new PropertyDescriptorEntity();
  d.setOptional(true);
  d.setPropertyName("propName");
  d.setDefaultValue("defaultValue");
  
  p.setDescriptor(d);
  p.setValue("");
  
  List<PropertyEntity> properties = new ArrayList<>();
  properties.add(p);
  
  // when
  Map<String, FreeMarkerProperty> result = c.translatePropertyList(properties , null, null, null, null, null);
  
  // then
  assertNotNull(result);
  assertEquals(0, result.keySet().size());
}

origin: liimaorg/liima

@Test
public void translatePropertyList_shouldAddProperty_keyOptionalFalse_and_value() {
  // given
  PropertyEntity p = new PropertyEntity();
  PropertyDescriptorEntity d = new PropertyDescriptorEntity();
  d.setOptional(false);
  d.setPropertyName("propName");
  
  p.setDescriptor(d);
  p.setValue("value");
  
  List<PropertyEntity> properties = new ArrayList<>();
  properties.add(p);
  
  // when
  Map<String, FreeMarkerProperty> result = c.translatePropertyList(properties , null, null, null, null, null);
  
  // then
  assertNotNull(result);
  assertEquals(1, result.keySet().size());
  assertEquals("value", result.get("propName").getCurrentValue());
}

origin: liimaorg/liima

@Test
public void translatePropertyList_shouldAddEmptyProperty_whenValueOptionalAndNoValue() {
  // given
  PropertyEntity p = new PropertyEntity();
  PropertyDescriptorEntity d = new PropertyDescriptorEntity();
  d.setOptional(false);
  d.setNullable(true);
  d.setPropertyName("propName");
  
  p.setDescriptor(d);
  p.setValue(null);
  
  List<PropertyEntity> properties = new ArrayList<>();
  properties.add(p);
  
  // when
  Map<String, FreeMarkerProperty> result = c.translatePropertyList(properties , null, null, null, null, null);
  
  // then
  assertNotNull(result);
  assertEquals(1, result.keySet().size());
  assertEquals(null, result.get("propName").getCurrentValue());
}

origin: liimaorg/liima

@Test
public void translatePropertyList_shouldAddProperty_withDefaultValue_keyOptionalFalse_and_no_value() {
  // given
  PropertyEntity p = new PropertyEntity();
  PropertyDescriptorEntity d = new PropertyDescriptorEntity();
  d.setOptional(false);
  d.setPropertyName("propName");
  d.setDefaultValue("defaultValue");
  
  p.setDescriptor(d);
  p.setValue(null);
  
  List<PropertyEntity> properties = new ArrayList<>();
  properties.add(p);
  
  // when
  Map<String, FreeMarkerProperty> result = c.translatePropertyList(properties , null, null, null, null, null);
  
  // then
  assertNotNull(result);
  assertEquals(1, result.keySet().size());
  assertEquals("defaultValue", result.get("propName").getCurrentValue());
}

origin: liimaorg/liima

@Test
public void translatePropertyList_shouldAddProperty_decriptedValue() {
  // given
  PropertyEntity p = new PropertyEntity();
  PropertyDescriptorEntity d = new PropertyDescriptorEntity();
  d.setOptional(false);
  d.setPropertyName("propName");
  d.setEncrypt(true);
  
  p.setDescriptor(d);
  p.setValue(TemplateUtils.encrypt("value"));
  
  List<PropertyEntity> properties = new ArrayList<>();
  properties.add(p);
  
  // when
  Map<String, FreeMarkerProperty> result = c.translatePropertyList(properties , null, null, null, null, null);
  
  // then
  assertNotNull(result);
  assertEquals(1, result.keySet().size());
  assertEquals("value", result.get("propName").getCurrentValue());
}

ch.puzzle.itc.mobiliar.business.generator.control.extracted.propertiesBasePropertyCollector

Most used methods

  • propertiesForContext
  • translatePropertyList
  • <init>
  • getDomainName
  • getPropertiesForRelation
  • getPropertiesForResource
  • propertiesForRelation
  • propertiesForResource
  • utils

Popular in Java

  • Start an intent from android
  • scheduleAtFixedRate (ScheduledExecutorService)
  • putExtra (Intent)
  • getApplicationContext (Context)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • JTable (javax.swing)
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now