Tabnine Logo
PropertyDescriptor.getKey
Code IndexAdd Tabnine to your IDE (free)

How to use
getKey
method
in
de.smartics.properties.api.core.domain.PropertyDescriptor

Best Java code snippets using de.smartics.properties.api.core.domain.PropertyDescriptor.getKey (Showing top 18 results out of 315)

origin: de.smartics.properties/smartics-properties-config

/**
 * Returns the hash code of the object.
 *
 * @return the hash code.
 * @see de.smartics.properties.api.config.domain.PropertyDefinition#hashCode()
 */
@Override
public int hashCode()
{
 return descriptor.getKey().hashCode();
}
origin: de.smartics.properties/smartics-properties-config

private void checkValidPair(final PropertyDescriptor descriptor,
  final Property property) throws IllegalArgumentException
{
 final String name = property.getName();
 final String descriptorName = descriptor.getKey().toString();
 if (!name.equals(descriptorName))
 {
  throw new IllegalArgumentException("Property value with key '" + name
                    + "' does not match the key '"
                    + descriptorName
                    + "' in the property descriptor.");
 }
}
origin: de.smartics.properties/smartics-properties-config

/**
 * Returns the missing mandatory properties as message text.
 *
 * @return the missing mandatory properties as message text.
 */
@MessageParam("mandatoryProperties")
public final String getMandatoryPropertiesAsText()
{
 final StringBuilder buffer = new StringBuilder();
 if (mandatoryProperties != null && !mandatoryProperties.isEmpty())
 {
  for (final PropertyDescriptor descriptor : mandatoryProperties)
  {
   buffer.append("  ").append(descriptor.getKey()).append('\n');
  }
 }
 return StringUtils.chomp(buffer.toString());
}
origin: de.smartics.properties/smartics-properties-report

/**
 * Returns the set of properties this property belongs to.
 *
 * @return the set of properties this property belongs to.
 */
public String getPropertySet()
{
 final String descriptorValue = descriptor.getKey().getPropertySet();
 if (StringUtils.isBlank(descriptorValue))
 {
  return sourceInfo.getElementTypeName();
 }
 return descriptorValue;
}
origin: de.smartics.properties/smartics-properties-core

for (final PropertyDescriptor descriptor : entry.getValue())
 buffer.append("\n    ").append(descriptor.getKey());
origin: de.smartics.properties/smartics-properties-core

/**
 * Default constructor.
 *
 * @param code the error or exception code of the exception.
 * @param cause the cause to the problem.
 * @param propertyDescriptor the descriptor of the property raising the
 *          exception.
 */
public PropertyDescriptorMessageBean(final PropertiesCode code,
  final Throwable cause, final PropertyDescriptor propertyDescriptor)
{
 super(code, cause, provide(propertyDescriptor).getKey());
 this.propertyDescriptor = provide(propertyDescriptor);
}
origin: de.smartics.properties/smartics-properties-core

 final PropertyDescriptor descriptor, final Locale locale)
final String target = descriptor.getKey().getPropertySet();
origin: de.smartics.properties/smartics-properties-report

/**
 * Returns the unique title of the report within the space.
 *
 * @return the unique title of the report within the space.
 */
public String getTitle()
{
 final String metadataValue = descriptor.getDocumentMetaData().getTitle();
 if (StringUtils.isBlank(metadataValue))
 {
  return descriptor.getKey().toString();
 }
 return metadataValue;
}
origin: de.smartics.properties/smartics-properties-report

private void checkForUniqueness(final PropertyReportItem item,
  final String name)
{
 keyUniquenessMap.put(name, item);
 final List<PropertyReportItem> items = keyUniquenessMap.get(name);
 if (items.size() > 1)
 {
  final StringBuilder buffer = new StringBuilder(1024);
  buffer.append("Duplicate key '" + name + "' found:");
  for (final PropertyReportItem duplicate : items)
  {
   buffer.append("\n -> ")
     .append(duplicate.getSourceInfo().getElementId()).append('/')
     .append(duplicate.getDescriptor().getKey());
  }
  final String message = buffer.toString();
  final ReportProblem problem = new ReportProblem(message);
  addProblem(problem);
 }
}
origin: de.smartics.properties/smartics-properties-config

final String key = descriptor.getKey().toString();
try
origin: de.smartics.properties/smartics-properties-config

boolean doReadUnlock = true;
final String key = descriptor.getKey().toString();
try
origin: de.smartics.properties/smartics-properties-config

/**
 * Returns <code>true</code> if the given object is semantically equal to the
 * given object, <code>false</code> otherwise.
 * <p>
 * It is assumed that a descriptor with its key is unique. Therefore two
 * definitions are equal, if their descriptor keys are equal, they share the
 * same value and source location of the value.
 * </p>
 *
 * @param object object the instance to compare to.
 * @return <code>true</code> if the given object is semantically equal to the
 *         given object, <code>false</code> otherwise.
 */
@Override
public boolean equals(final Object object)
{
 if (this == object)
 {
  return true;
 }
 else if (object == null || getClass() != object.getClass())
 {
  return false;
 }
 final PropertyDefinition other = (PropertyDefinition) object;
 return (descriptor.getKey().equals(other.descriptor.getKey())
     && ObjectUtils.equals(property.getValue(),
       other.property.getValue()) && ObjectUtils.equals(
   property.getSource(), other.property.getSource()));
}
origin: de.smartics.properties/smartics-properties-core

private void addDescriptor(final Class<?> propertySetType,
  final PropertyDescriptor descriptor,
  final List<DuplicatePropertyDeclarationException> exceptions)
{
 final String key = descriptor.getKey().toString();
 writeLock.lock();
 try
 {
  final PropertyDescriptor currentDescriptor = descriptorMap.get(key);
  if (currentDescriptor != null
    && currentDescriptor.getDeclaringType() != descriptor
      .getDeclaringType())
  {
   exceptions.add(new DuplicatePropertyDeclarationException(
     new PropertyDescriptorClashingMessageBean(
       PropertyCode.DUPLICATE_DECLARATION, currentDescriptor,
       descriptor)));
  }
  descriptors.put(propertySetType, descriptor);
  descriptorMap.put(key, descriptor);
  if (descriptor.isMandatory())
  {
   mandatoryProperties.add(descriptor);
  }
 }
 finally
 {
  writeLock.unlock();
 }
}
origin: de.smartics.properties/smartics-properties-config

private DescribedProperty getPropertyInternal(
  final PropertyDescriptor descriptor)
{
 final String name = descriptor.getKey().toString();
 final Property property = getPropertyFromStore(name);
 // if (property == null || property.getValue() == null)
 // { // if alternative lookups have to be provided, the 'properties' have to
 // be updated on every change.
 // final Property alt = properties.getValue(name);
 // property = alt != null ? alt : property;
 // }
 final DescribedProperty describedProperty =
   new DescribedProperty(this.getKey(), descriptor, property);
 return describedProperty;
}
origin: de.smartics.properties/smartics-properties-config

private void addProperties(
  final Map<Class<?>, List<PropertyDescriptor>> descriptorMap,
  final MultiSourceProperties compositeProperties)
{
 final Properties properties = new Properties();
 for (final Entry<Class<?>, List<PropertyDescriptor>> entry : descriptorMap
   .entrySet())
 {
  final List<PropertyDescriptor> descriptors = entry.getValue();
  for (final PropertyDescriptor descriptor : descriptors)
  {
   final String propertyKey = descriptor.getKey().toString();
   final Property property =
     compositeProperties.getValue(propertyKey, true);
   if (property != null && property.getValue() != null)
   {
    properties.put(propertyKey, property);
   }
  }
 }
 final ConfigurationKey<?> key = compositeProperties.getConfigurationKey();
 final ConfigurationPropertiesManagement configuration =
   factoryCache.ensureManagement(key);
 final PropertyProvider provider =
   new PropertiesPropertyProvider(key, new PropertyLocation(
     "classpath-various"), properties);
 configuration.addDefinitions(provider);
}
origin: de.smartics.properties/smartics-properties-report

@Override
public void handle(final PropertyReportItem item) throws ReportException
{
 super.handle(item);
 final PropertyDescriptor descriptor = item.getDescriptor();
 final String key = descriptor.getKey().toString();
 final PropertyExpression expression = descriptor.getDefaultExpression();
 final String value =
   expression != null && expression.getExpression() != null ? expression
     .getExpression() : "";
 currentProperties.setProperty(key, value);
}
origin: de.smartics.properties/smartics-properties-config

private void addProperties(final MultiSourceProperties compositeProperties)
{
 final Properties properties = new Properties();
 final Class<?> type = BootProperties.class;
 final PropertiesContext context = configuration.getContext(type);
 final PropertyMetaDataParser propertyDescriptorParser =
   PropertyMetaDataParser.create(context);
 final List<PropertyDescriptor> descriptors =
   propertyDescriptorParser.readDescriptors(type);
 for (final PropertyDescriptor descriptor : descriptors)
 {
  final String propertyKey = descriptor.getKey().toString();
  final Property property = compositeProperties.getValue(propertyKey);
  if (property != null && property.getValue() != null)
  {
   properties.put(propertyKey, property);
  }
  else
  {
   properties.remove(propertyKey);
  }
 }
 configuration.addDescriptors(type);
 final PropertyProvider provider =
   new PropertiesPropertyProvider(configuration.getKey(),
     new PropertyLocation("boot-various"), properties);
 configuration.addDefinitions(provider);
}
origin: de.smartics.properties/smartics-properties-report

if (descriptor != null)
 final PropertyKey key = descriptor.getKey();
 addElement(rootElement, "name", key);
 final PropertyType type = descriptor.getType();
de.smartics.properties.api.core.domainPropertyDescriptorgetKey

Javadoc

Returns the key of the property.

This value must not be null.

Popular methods of PropertyDescriptor

  • getConstraints
    Returns a list of constraints a value for the property has to meet.
  • getDefaultExpression
    Returns the expression to use to construct the value of the property. An expression may reference an
  • getDocumentName
    Returns the name of the document that identifies the document uniquely within the context of the pro
  • getType
    Returns the type of the property value. This value must not be null. If there is no value range sp
  • getValueRange
    Returns the range of values allowed for this property. The returned value may be null if there is no
  • isMandatory
    Checks if the property is mandatory to be not null. If the property is not mandatory, it is optional
  • getCategories
    Returns the categories this property is associated with.
  • getDeclaringType
    Returns the type that declares the property that is described by this instance.
  • getDocumentMetaData
    Returns the meta data information for the property. This value must not be null.
  • getUpdateIntervalInMs
    Returns the update interval in milliseconds (ms). An application may cache the value of the property
  • getUseType
    Returns the use type of the property.
  • isRuntimeMutable
    Checks whether or not the property is mutable at runtime.
  • getUseType,
  • isRuntimeMutable,
  • isSecured

Popular in Java

  • Running tasks concurrently on multiple threads
  • getResourceAsStream (ClassLoader)
  • getExternalFilesDir (Context)
  • scheduleAtFixedRate (Timer)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • ImageIO (javax.imageio)
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Best plugins for Eclipse
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