Examples of AbstractConverter


Examples of com.jgoodies.binding.value.AbstractConverter

        ValueModel mdlOnlyUnread = new PreferencesAdapter(prefs, PROP_WH_UNREAD_ONLY, false);
        chOnlyUnread = ComponentsFactory.createCheckBox(Strings.message("whatshot.unreadonly"),
            new ToggleButtonAdapter(mdlOnlyUnread));

        // Time options
        ValueModel mdlTimeOption = new AbstractConverter(
            new PreferencesAdapter(prefs, PROP_WH_TIME_OPTION, TimeOption.THIS_WEEK.getCode()))
        {
            public Object convertFromSubject(Object o)
            {
                return TimeOption.fromCode((Integer)o);
View Full Code Here

Examples of com.jgoodies.binding.value.AbstractConverter

                guides.add(fg);
                guidesMap.put(fg.key, fg);
            }

            ValueModel mdlGuides = new AbstractConverter(
                new PropertyAdapter(prefs, UserPreferences.PROP_WH_TARGET_GUIDE))
            {
                public Object convertFromSubject(Object o)
                {
                    return guidesMap.get(o);
View Full Code Here

Examples of net.sf.joafip.store.service.binary.AbstractConverter

  protected ReferenceLink unmarshallElement(final byte[] binary,
      final int offset) throws HeapRecordableException {
    try {
      int currentOffset = offset;

      AbstractConverter binaryConverter;
      try {
        binaryConverter = helperBinaryConversion.integerConverter;
        binaryConverter.fromBinary(binary, currentOffset);
      } catch (BinaryConverterException exception) {
        throw new HeapRecordableException(exception);
      }
      if (!binaryConverter.valueDefinedFromBinary) {
        throw new HeapRecordableException(
            "number of referencing value must be defined");
      }
      final int numberOfReferencing = (Integer) binaryConverter.objectFromBinary;
      binaryConverter.objectFromBinary = null;// NOPMD
      currentOffset += HelperBinaryConversion.INT_BYTE_SIZE;
      binaryConverter = helperBinaryConversion.referenceConverter;
      binaryConverter.fromBinary(binary, currentOffset);
      final DataRecordIdentifier referenced = (DataRecordIdentifier) binaryConverter.objectFromBinary;
      binaryConverter.objectFromBinary = null;// NOPMD
      currentOffset += HelperBinaryConversion.REFERENCE_BYTE_SIZE;

      final ReferenceLink referenceLink = new ReferenceLink(referenced);
      for (int count = 0; count < numberOfReferencing; count++) {
        binaryConverter = helperBinaryConversion.referenceConverter;
        binaryConverter.fromBinary(binary, currentOffset);
        if (!binaryConverter.valueDefinedFromBinary) {
          throw new HeapRecordableException(
              "referencing data record identifier value must be defined");
        }
        final DataRecordIdentifier referencing = (DataRecordIdentifier)
        /**/binaryConverter.objectFromBinary;
        binaryConverter.objectFromBinary = null;// NOPMD
        currentOffset += HelperBinaryConversion.REFERENCE_BYTE_SIZE;
        try {
          binaryConverter = helperBinaryConversion.integerConverter;
          binaryConverter.fromBinary(binary, currentOffset);
        } catch (BinaryConverterException exception) {
          throw new HeapRecordableException(exception);
        }
        if (!binaryConverter.valueDefinedFromBinary) {
          throw new HeapRecordableException(
View Full Code Here

Examples of net.sf.joafip.store.service.binary.AbstractConverter

        true, element);
  }

  protected DataRecordIdentifier unmarshallElement(final byte[] binary,
      final int offset) throws HeapRecordableException {
    AbstractConverter binaryConverter;
    try {
      binaryConverter = helperBinaryConversion.referenceConverter;
      binaryConverter.fromBinary(binary, offset);
    } catch (BinaryConverterException exception) {
      throw new HeapRecordableException(exception);
    }
    if (!binaryConverter.valueDefinedFromBinary) {
      throw new HeapRecordableException(
View Full Code Here

Examples of net.sf.joafip.store.service.binary.AbstractConverter

  private Boolean colorFromBinary(
      final HelperBinaryConversion helperBinaryConversion,
      final byte[] binary, final int offset)
      throws HeapRecordableException {
    AbstractConverter binaryConverter;
    try {
      binaryConverter = helperBinaryConversion.booleanConverter;
      binaryConverter.fromBinary(binary, offset);
    } catch (BinaryConverterException exception) {
      throw new HeapRecordableException(exception);
    }
    if (!binaryConverter.valueDefinedFromBinary) {
      throw new HeapRecordableException("color value must be defined");
View Full Code Here

Examples of net.sf.joafip.store.service.binary.AbstractConverter

  private Integer numberOfChildFromBinary(
      final HelperBinaryConversion helperBinaryConversion,
      final byte[] binary, final int offset)
      throws HeapRecordableException {
    AbstractConverter binaryConverter;
    try {
      binaryConverter = helperBinaryConversion.integerConverter;
      binaryConverter.fromBinary(binary, offset);
    } catch (BinaryConverterException exception) {
      throw new HeapRecordableException(exception);
    }
    if (!binaryConverter.valueDefinedFromBinary) {
      throw new HeapRecordableException(
View Full Code Here

Examples of net.sf.joafip.store.service.binary.AbstractConverter

  private DataRecordIdentifier dataRecordIdentifierFromBinary(
      final HelperBinaryConversion helperBinaryConversion,
      final byte[] binary, final int offset)
      throws HeapRecordableException {
    AbstractConverter binaryConverter;
    try {
      binaryConverter = helperBinaryConversion.nullableAndTypedReferenceConverter;
      binaryConverter.fromBinary(binary, offset);
    } catch (BinaryConverterException exception) {
      throw new HeapRecordableException(exception);
    }
    if (!binaryConverter.valueDefinedFromBinary) {
      throw new HeapRecordableException(
View Full Code Here

Examples of net.sf.joafip.store.service.binary.AbstractConverter

  @Override
  public void unmarshall(final byte[] binary) throws HeapRecordableException {
    int offset = 0;

    final AbstractConverter nullableAndTypedReferenceConverter = helperBinaryConversion.nullableAndTypedReferenceConverter;
    final AbstractConverter byteConverter = helperBinaryConversion.byteConverter;
    final AbstractConverter booleanConverter = helperBinaryConversion.booleanConverter;
    try {
      nullableAndTypedReferenceConverter.fromBinary(binary, offset);
      toGarbageRootDataRecordIdentifier =
      /**/(DataRecordIdentifier) nullableAndTypedReferenceConverter.objectFromBinary;
      offset += HelperBinaryConversion.REFERENCE_NULLABLE_BYTE_SIZE;

      nullableAndTypedReferenceConverter.fromBinary(binary, offset);
      assertValueDefined(nullableAndTypedReferenceConverter);
      garbageCandidateRootDataRecordIdentifier =
      /**/(DataRecordIdentifier) nullableAndTypedReferenceConverter.objectFromBinary;
      offset += HelperBinaryConversion.REFERENCE_NULLABLE_BYTE_SIZE;

      nullableAndTypedReferenceConverter.fromBinary(binary, offset);
      assertValueDefined(nullableAndTypedReferenceConverter);
      garbageReferenceLinkRootDataRecordIdentifier =
      /**/(DataRecordIdentifier) nullableAndTypedReferenceConverter.objectFromBinary;
      offset += HelperBinaryConversion.REFERENCE_NULLABLE_BYTE_SIZE;

      nullableAndTypedReferenceConverter.fromBinary(binary, offset);
      assertValueDefined(nullableAndTypedReferenceConverter);
      classNameListRootDataRecordIdentifier =
      /**/(DataRecordIdentifier) nullableAndTypedReferenceConverter.objectFromBinary;
      offset += HelperBinaryConversion.REFERENCE_NULLABLE_BYTE_SIZE;

      nullableAndTypedReferenceConverter.fromBinary(binary, offset);
      assertValueDefined(nullableAndTypedReferenceConverter);
      toVisitByCollectorRootDataRecordIdentifier =
      /**/(DataRecordIdentifier) nullableAndTypedReferenceConverter.objectFromBinary;
      offset += HelperBinaryConversion.REFERENCE_NULLABLE_BYTE_SIZE;

      nullableAndTypedReferenceConverter.fromBinary(binary, offset);
      assertValueDefined(nullableAndTypedReferenceConverter);
      visitedByCollectorRootDataRecordIdentifier =
      /**/(DataRecordIdentifier) nullableAndTypedReferenceConverter.objectFromBinary;
      offset += HelperBinaryConversion.REFERENCE_NULLABLE_BYTE_SIZE;

      nullableAndTypedReferenceConverter.fromBinary(binary, offset);
      assertValueDefined(nullableAndTypedReferenceConverter);
      garbageCandidateInProcess =
      /**/(DataRecordIdentifier) nullableAndTypedReferenceConverter.objectFromBinary;
      offset += HelperBinaryConversion.REFERENCE_NULLABLE_BYTE_SIZE;

      byteConverter.fromBinary(binary, offset);
      assertValueDefined(byteConverter);
      garbageCollectorState =
      /**/(Byte) byteConverter.objectFromBinary;
      offset += HelperBinaryConversion.BYTE_BYTE_SIZE;

      booleanConverter.fromBinary(binary, offset);
      assertValueDefined(booleanConverter);
      garbageManagement = (Boolean) booleanConverter.objectFromBinary;

      nullableAndTypedReferenceConverter.objectFromBinary = null; // NOPMD
      byteConverter.objectFromBinary = null; // NOPMD
View Full Code Here

Examples of net.sf.joafip.store.service.binary.AbstractConverter

      final int bodyBeginOffset, final ClassInfo objectClass,
      final DataRecordIdentifier dataRecordIdentifier)
      throws ObjectIOException, ObjectIODataRecordNotFoundException,
      ObjectIODataCorruptedException {
    final ForTestClass read = new ForTestClass();
    AbstractConverter binaryConverter;
    try {
      binaryConverter = helperBinaryConversion.characterConverter;
      binaryConverter.fromBinary(binary, bodyBeginOffset);
    } catch (BinaryConverterException exception) {
      throw new ObjectIOException(exception);
    }
    if (!binaryConverter.valueDefinedFromBinary) {
      throw new ObjectIOException("value must be defined");
View Full Code Here

Examples of net.sf.joafip.store.service.binary.AbstractConverter

    System.arraycopy(className, 0, binary, offset, className.length);
  }

  public void unmarshall(final byte[] binary) throws HeapRecordableException {
    int offset = 0;
    AbstractConverter binaryConverter;
    try {
      binaryConverter = helperBinaryConversion.integerConverter;
      binaryConverter.fromBinary(binary, offset);
    } catch (BinaryConverterException exception) {
      throw new HeapRecordableException(exception);
    }
    if (!binaryConverter.valueDefinedFromBinary) {
      throw new HeapRecordableException(
          "class name identifier value must be defined");
    }
    classNameIdentifier = (Integer) binaryConverter.objectFromBinary;
    binaryConverter.objectFromBinary = null;// NOPMD
    offset += HelperBinaryConversion.INT_BYTE_SIZE;
    try {
      binaryConverter = helperBinaryConversion.nullableAndTypedReferenceConverter;
      binaryConverter.fromBinary(binary, offset);
    } catch (BinaryConverterException exception) {
      throw new HeapRecordableException(exception);
    }
    if (!binaryConverter.valueDefinedFromBinary) {
      throw new HeapRecordableException(
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.