public static DecoupledInjectedAttribute createAttribute(
            final char[] buffer,
            final int nameOffset, final int nameLen,
            final int operatorOffset, final int operatorLen,
            final int valueContentOffset, final int valueContentLen,
            final int valueOuterOffset, final int valueOuterLen) {

        final char[] newBuffer = new char[nameLen + operatorLen + valueOuterLen];
        System.arraycopy(buffer, nameOffset, newBuffer, 0, nameLen);
        System.arraycopy(buffer, operatorOffset, newBuffer, nameLen, operatorLen);
        System.arraycopy(buffer, valueOuterOffset, newBuffer, (nameLen + operatorLen), valueOuterLen);

        return new DecoupledInjectedAttribute(
                newBuffer,
                0, nameLen,
                (operatorOffset - nameOffset), operatorLen,
                (valueContentOffset - nameOffset), valueContentLen,
                (valueOuterOffset - nameOffset), valueOuterLen);
    }
public static DecoupledInjectedAttribute createAttribute ( final char [ ] buffer , final int nameOffset , final int nameLen , final int operatorOffset , final int operatorLen , final int valueContentOffset , final int valueContentLen , final int valueOuterOffset , final int valueOuterLen ) { final char [ ] newBuffer = new char [ nameLen + operatorLen + valueOuterLen ] ; System . arraycopy ( buffer , nameOffset , newBuffer , 0 , nameLen ) ; System . arraycopy ( buffer , operatorOffset , newBuffer , nameLen , operatorLen ) ; System . arraycopy ( buffer , valueOuterOffset , newBuffer , ( nameLen + operatorLen ) , valueOuterLen ) ; return new DecoupledInjectedAttribute ( newBuffer , 0 , nameLen , ( operatorOffset - nameOffset ) , operatorLen , ( valueContentOffset - nameOffset ) , valueContentLen , ( valueOuterOffset - nameOffset ) , valueOuterLen ) ; }
/*
We use a factory method here because we will not be using the same buffer specified for this method, so we
require a bit of processing before actually calling a constructor (not that this could not be done at the
constructor, but it gives us higher flexibility this way. Maybe in the future we reuse instances or something...