public void convertSource ( final Builder builder ) { Variant sourceValue; sourceValue = builder.getAttributes ().remove ( this.tag ); if ( sourceValue != null ) { builder.setAttribute ( this.attributeName, sourceValue ); } sourceValue = builder.getAttributes ().remove ( this.attributeCountName ); if ( sourceValue != null && this.debug ) { builder.setAttribute ( String.format ( "%s.%s.count", this.prefix, this.tag ), sourceValue ); } sourceValue = builder.getAttributes ().remove ( this.tag + ".items" ); if ( sourceValue != null && this.debug ) { builder.setAttribute ( String.format ( "%s.%s.items", this.prefix, this.tag ), sourceValue ); } }
protected void injectAttributes ( final Map<String, Object> context, final Builder builder ) { if ( this.configuration == null ) { return; } if ( this.configuration.active ) { context.putAll ( this.configuration.markers ); } if ( this.configuration.exportAttribute ) { if ( this.configuration.active || this.configuration.alwaysExport ) { builder.setAttribute ( this.attrActive, Variant.valueOf ( this.configuration.active ) ); } } }
public void end ( final Map<String, Object> context, final Builder builder ) { if ( this.debug ) { builder.setAttribute ( this.prefix + ".after", Variant.valueOf ( StringHelper.join ( this.contextSet, "," ) ) ); } builder.setAttribute ( this.tag, Variant.valueOf ( this.matches != 0 ) ); if ( this.debug ) { builder.setAttribute ( this.tag + ".count", Variant.valueOf ( this.matches ) ); } this.contextSet = null; }
@Override public void dataUpdate ( final Map<String, Object> context, final DataItemValue.Builder builder ) { if ( builder == null ) { return; } try { processDataUpdate ( context, builder ); } catch ( final Throwable e ) { builder.setAttribute ( getPrefixed ( "error", Activator.getStringInterner () ), Variant.TRUE ); builder.setAttribute ( getPrefixed ( "error.message", Activator.getStringInterner () ), Variant.valueOf ( e.getMessage () ) ); } }
@Override protected void processDataUpdate ( final Map<String, Object> context, final DataItemValue.Builder builder ) throws Exception { injectAttributes ( builder ); if ( this.active ) { builder.setAttribute ( this.attrValueOriginal, builder.getValue () ); } final Variant val = builder.getValue (); if ( val == null || val.isNull () ) { return; } builder.setValue ( handleDataUpdate ( builder.getValue () ) ); }
@Override protected void processDataUpdate ( final Map<String, Object> context, final DataItemValue.Builder builder ) throws Exception { injectAttributes ( builder ); builder.setAttribute ( this.attrValueOriginal, builder.getValue () ); final Variant val = builder.getValue (); if ( val == null || val.isNull () ) { return; } builder.setValue ( handleDataUpdate ( builder.getValue () ) ); }
public void start ( final Map<String, Object> context, final Builder builder ) { this.contextSet = getContextSet ( context, this.contextAttribute ); if ( this.debug ) { builder.setAttribute ( this.prefix + ".before", Variant.valueOf ( StringHelper.join ( this.contextSet, "," ) ) ); } this.matches = 0; }
private void replaceAttribute ( final Builder builder, final String attribute, final String renamedAttribute, final Variant replacement ) { final Variant value = builder.getAttributes ().remove ( attribute ); if ( value != null ) { builder.setAttribute ( attribute, replacement ); builder.setAttribute ( renamedAttribute, value ); } }
private static DataItemValue initValue () { final DataItemValue.Builder builder = new Builder (); builder.setAttribute ( "master.uninitialized", Variant.TRUE ); return builder.build (); }
public Builder setTimestamp ( final Calendar timestamp ) { if ( timestamp == null ) { clearAttribute ( "timestamp" ); } else { setAttribute ( "timestamp", Variant.valueOf ( timestamp.getTimeInMillis () ) ); } return this; }
public Builder setTimestamp ( final long timestamp ) { setAttribute ( "timestamp", Variant.valueOf ( timestamp ) ); return this; }
public Builder setTimestamp ( final long timestamp ) { setAttribute ( "timestamp", Variant.valueOf ( timestamp ) ); return this; }
protected void injectAttributes ( final Builder builder ) { builder.setAttribute ( this.attrActive, this.active ? Variant.TRUE : Variant.FALSE ); }
private void injectTimestamp ( final Builder builder, final ManualStateData state ) { if ( state.getTimestmap () != null ) { // we always inject a new timestamp final Variant originalTimestamp = builder.getAttributes ().get ( "timestamp" ); //$NON-NLS-1$ builder.setAttribute ( "timestamp", Variant.valueOf ( state.getTimestmap ().getTime () ) ); //$NON-NLS-1$ if ( originalTimestamp != null ) { builder.setAttribute ( this.attrTimestampOriginal, originalTimestamp ); } } }
protected void injectAttributes ( final Builder builder ) { builder.setAttribute ( this.attrBlocked, Variant.valueOf ( this.active ) ); builder.setAttribute ( this.attrActive, Variant.valueOf ( this.active ) ); builder.setAttribute ( this.attrNote, Variant.valueOf ( this.note ) ); builder.setAttribute ( this.attrUser, Variant.valueOf ( this.user ) ); builder.setAttribute ( this.attrTimestamp, Variant.valueOf ( this.timestamp ) ); }
public Builder setTimestamp ( final Calendar timestamp ) { if ( timestamp == null ) { clearAttribute ( "timestamp" ); } else { setAttribute ( "timestamp", Variant.valueOf ( timestamp.getTimeInMillis () ) ); } return this; }
@Override protected void processDataUpdate ( final Map<String, Object> context, final DataItemValue.Builder builder ) throws Exception { injectAttributes ( builder ); builder.setAttribute ( this.attrValueOriginal, builder.getValue () ); final Variant val = builder.getValue (); if ( val == null || val.isNull () ) { return; } builder.setValue ( handleDataUpdate ( builder.getValue () ) ); }
protected void injectAttributes ( final Builder builder ) { builder.setAttribute ( this.attrActive, this.active ? Variant.TRUE : Variant.FALSE ); if ( this.type != null && this.type != RoundType.NONE ) { builder.setAttribute ( this.attrType, Variant.valueOf ( this.type.toString () ) ); } if ( this.error != null ) { builder.setAttribute ( this.attrError, Variant.valueOf ( this.error ) ); } }
protected void injectAttributes ( final Builder builder ) { builder.setAttribute ( this.attrActive, this.active ? Variant.TRUE : Variant.FALSE ); builder.setAttribute ( this.attrFactor, Variant.valueOf ( this.factor ) ); builder.setAttribute ( this.attrOffset, Variant.valueOf ( this.offset ) ); }
protected void injectAttributes ( final Builder builder ) { builder.setAttribute ( getPrefixed ( null, null ), this.state.getValue ().isNull () ? Variant.FALSE : Variant.TRUE ); builder.setAttribute ( this.attrActive, this.state.getValue ().isNull () ? Variant.FALSE : Variant.TRUE ); builder.setAttribute ( this.attrValue, this.state.getValue () ); builder.setAttribute ( this.attrReason, Variant.valueOf ( this.state.getReason () ) ); builder.setAttribute ( this.attrUser, Variant.valueOf ( this.state.getUser () ) ); }