@Override protected String interpolate(String text) { if(text == null) { return null; } return replacer.replaceProperties(text); } }
public static PropertyReplacer propertyReplacer(final DeploymentUnit deploymentUnit) { Boolean replacement = deploymentUnit.getAttachment(Attachments.JBOSS_DESCRIPTOR_PROPERTY_REPLACEMENT); if (replacement == null || replacement) { PropertyReplacer replacer = deploymentUnit .getAttachment(org.jboss.as.ee.metadata.property.Attachments.FINAL_PROPERTY_REPLACER); return replacer != null ? replacer : PropertyReplacers.noop(); } else { return PropertyReplacers.noop(); } }
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); CompositePropertyResolver propertyResolver = new CompositePropertyResolver(deploymentUnit.getAttachment(Attachments.DEPLOYMENT_PROPERTY_RESOLVERS)); deploymentUnit.putAttachment(Attachments.FINAL_PROPERTY_RESOLVER, propertyResolver); deploymentUnit.putAttachment(Attachments.FINAL_PROPERTY_REPLACER, PropertyReplacers.resolvingReplacer(propertyResolver)); }
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); DeploymentUnit current = deploymentUnit; final List<PropertyResolver> propertyResolvers = new ArrayList<PropertyResolver>(); do { final Properties deploymentProperties = current.getAttachment(Attachments.DEPLOYMENT_PROPERTIES); if (deploymentProperties != null) { propertyResolvers.add(new PropertiesPropertyResolver(deploymentProperties)); } current = current.getParent(); } while (current != null); if (!propertyResolvers.isEmpty()) { deploymentUnit.addToAttachmentList(Attachments.DEPLOYMENT_PROPERTY_RESOLVERS, new CompositePropertyResolver(propertyResolvers)); } }
public void setPolicy(String value) { this.policy = (this.replacer != null) ? this.replacer.replaceProperties(value) : value; }
public static PropertyReplacer propertyReplacer(final DeploymentUnit deploymentUnit) { Boolean replacement = deploymentUnit.getAttachment(Attachments.SPEC_DESCRIPTOR_PROPERTY_REPLACEMENT); if (replacement == null || replacement) { PropertyReplacer replacer = deploymentUnit.getAttachment(org.jboss.as.ee.metadata.property.Attachments.FINAL_PROPERTY_REPLACER); // Replacer might be null if the EE subsystem isn't installed (e.g. sar w/o ee) TODO clean up this relationship return replacer != null ? replacer : PropertyReplacers.noop(); } else { return PropertyReplacers.noop(); } }
private static String getElementText(final XMLStreamReader reader, final PropertyReplacer propertyReplacer) throws XMLStreamException { return propertyReplacer.replaceProperties(reader.getElementText()); }
public static PropertyReplacer propertyReplacer(final DeploymentUnit deploymentUnit) { Boolean replacement = deploymentUnit.getAttachment(Attachments.JBOSS_DESCRIPTOR_PROPERTY_REPLACEMENT); if (replacement == null || replacement) { PropertyReplacer replacer = deploymentUnit.getAttachment(org.jboss.as.ee.metadata.property.Attachments.FINAL_PROPERTY_REPLACER); // Replacer might be null if the EE subsystem isn't installed (e.g. sar w/o ee) TODO clean up this relationship return replacer != null ? replacer : PropertyReplacers.noop(); } else { return PropertyReplacers.noop(); } }
protected String readResolveValue(final XMLExtendedStreamReader reader, final int index) { return propertyReplacer.replaceProperties(reader.getAttributeValue(index).trim()); }
public static PropertyReplacer propertyReplacer(final DeploymentUnit deploymentUnit) { Boolean replacement = deploymentUnit.getAttachment(Attachments.ANNOTATION_PROPERTY_REPLACEMENT); if (replacement == null || replacement) { PropertyReplacer replacer = deploymentUnit.getAttachment(org.jboss.as.ee.metadata.property.Attachments.FINAL_PROPERTY_REPLACER); // Replacer might be null if the EE subsystem isn't installed (e.g. sar w/o ee) TODO clean up this relationship return replacer != null ? replacer : PropertyReplacers.noop(); } else { return PropertyReplacers.noop(); } }
@Override protected String fromAnnotation(final AnnotationInstance annotationInstance, final PropertyReplacer propertyReplacer) { AnnotationValue value = annotationInstance.value(); if (value == null) { return null; } return propertyReplacer.replaceProperties(value.asString()); } }
@Override protected String[] fromAnnotation(final AnnotationInstance annotationInstance, final PropertyReplacer propertyReplacer) { String[] values = annotationInstance.value().asStringArray(); for (int i = 0; i < values.length; i++) { values[i] = propertyReplacer.replaceProperties(values[i]); } return values; } }
@Override protected String fromAnnotation(final AnnotationInstance annotationInstance, final PropertyReplacer propertyReplacer) { return propertyReplacer.replaceProperties(annotationInstance.value().asString()); } }
@Override protected String fromAnnotation(final AnnotationInstance annotationInstance, final PropertyReplacer propertyReplacer) { String resourceAdapterValue = annotationInstance.value().asString(); return propertyReplacer.replaceProperties(resourceAdapterValue); } }
@Override protected String fromAnnotation(final AnnotationInstance annotationInstance, final PropertyReplacer propertyReplacer) { return propertyReplacer.replaceProperties(annotationInstance.value().asString()); } }
@Override protected String[] fromAnnotation(final AnnotationInstance annotationInstance, final PropertyReplacer propertyReplacer) { String[] values = annotationInstance.value().asStringArray(); for (int i = 0; i < values.length; i++) { values[i] = propertyReplacer.replaceProperties(values[i]); } return values; } }
@Override protected String[] fromAnnotation(final AnnotationInstance annotationInstance, final PropertyReplacer propertyReplacer) { String[] values = annotationInstance.value().asStringArray(); for (int i = 0; i < values.length; i++) { values[i] = propertyReplacer.replaceProperties(values[i]); } return values; } }
@Override protected String fromAnnotation(final AnnotationInstance annotationInstance, final PropertyReplacer propertyReplacer) { return propertyReplacer.replaceProperties(annotationInstance.value().asString()); } }
private String stringValueOrNull(final AnnotationInstance annotation, final String attribute) { final AnnotationValue value = annotation.value(attribute); return (value != null) ? propertyReplacer.replaceProperties(value.asString()) : null; }
@Override protected CacheInfo fromAnnotation(AnnotationInstance annotationInstance, PropertyReplacer propertyReplacer) { String value = annotationInstance.value().asString(); return new CacheInfo(propertyReplacer.replaceProperties(value)); } }