test_class.declarator: POSITIVE_OFFSET_WP_LINE_LOCATION = 150
test_class.modifier: private static final
test_class.original_string: private static final int POSITIVE_OFFSET_WP_LINE_LOCATION = 150;
test_class.type: int
test_class.var_name: POSITIVE_OFFSET_WP_LINE_LOCATION
test_class.declarator: whitePaperLineLocation
test_class.modifier: private
test_class.original_string: private OpenLR whitePaperLineLocation;
test_class.type: OpenLR
test_class.var_name: whitePaperLineLocation
test_class.declarator: invalidXML
test_class.modifier: private
test_class.original_string: private OpenLR invalidXML;
test_class.type: OpenLR
test_class.var_name: invalidXML
test_class.declarator: missingLastLrp
test_class.modifier: private
test_class.original_string: private OpenLR missingLastLrp;
test_class.type: OpenLR
test_class.var_name: missingLastLrp
test_class.file: xml/src/test/java/openlr/xml/OpenLRXMLDecoderTest.java
test_class.identifier: OpenLRXMLDecoderTest
test_case.body: @Test
      public final void testMissingLastLrpLocation() {
          OpenLRXMLDecoder dec = new OpenLRXMLDecoder();
          try {
              LocationReference lr = new LocationReferenceXmlImpl("", missingLastLrp, 1);
              RawLocationReference ref = dec.decodeData(lr);
              assertFalse(ref.isValid());
              assertEquals(ref.getLocationType(), LocationType.LINE_LOCATION);
              assertSame(ref.getReturnCode(), XmlReturnCode.NO_LAST_LRP_FOUND);
  
              assertNull(ref.getGeoCoordinates());
              assertNull(ref.getLocationReferencePoints());
              assertNull(ref.getOffsets());
              assertNull(ref.getOrientation());
              assertNull(ref.getSideOfRoad());
  
          } catch (PhysicalFormatException e) {
              fail("Unexpected exception!", e);
          }
      }
test_case.class_method_signature: OpenLRXMLDecoderTest.testMissingLastLrpLocation()
test_case.full_signature: @Test public final void testMissingLastLrpLocation()
test_case.identifier: testMissingLastLrpLocation
test_case.invocations: decodeData assertFalse isValid assertEquals getLocationType assertSame getReturnCode assertNull getGeoCoordinates assertNull getLocationReferencePoints assertNull getOffsets assertNull getOrientation assertNull getSideOfRoad fail
test_case.modifiers: @Test public final
test_case.parameters: ()
test_case.return: void
test_case.signature: void testMissingLastLrpLocation()
focal_class.file: xml/src/main/java/openlr/xml/OpenLRXMLDecoder.java
focal_class.identifier: OpenLRXMLDecoder
focal_class.interfaces: implements PhysicalDecoder
focal_class.class_method_signature: OpenLRXMLDecoder.decodeData(final LocationReference lr)
focal_class.full_signature: @Override public final RawLocationReference decodeData(final LocationReference lr)
focal_class.identifier: decodeData
focal_class.modifiers: @Override public final
focal_class.parameters: (final LocationReference lr)
focal_class.return: RawLocationReference
focal_class.signature: RawLocationReference decodeData(final LocationReference lr)
focal_class.class_method_signature: OpenLRXMLDecoder.getDataClass()
focal_class.full_signature: public final Class<?> getDataClass()
focal_class.identifier: getDataClass
focal_class.modifiers: public final
focal_class.parameters: ()
focal_class.return: Class<?>
focal_class.signature: Class<?> getDataClass()
focal_class.class_method_signature: OpenLRXMLDecoder.getDataFormatIdentifier()
focal_class.full_signature: public final String getDataFormatIdentifier()
focal_class.identifier: getDataFormatIdentifier
focal_class.modifiers: public final
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getDataFormatIdentifier()
focal_method.body: @Override
      public final RawLocationReference decodeData(final LocationReference lr)
              throws PhysicalFormatException {
          Object data = lr.getLocationReferenceData();
          if (!(data instanceof OpenLR)) {
              throw new OpenLRXMLException(XMLErrorType.DATA_ERROR,
                      "incorrect data class");
          }
          OpenLR xmlData = (OpenLR) data;
          String id = xmlData.getLocationID();
          XMLLocationReference xmlLoc = xmlData.getXMLLocationReference();
          if (xmlLoc == null) {
              throw new OpenLRXMLException(XMLErrorType.BINARY_DATA_ONLY,
                      "cannot decode binary string using xml package");
          }
  
          LineLocationReference lineLoc = xmlLoc.getLineLocationReference();
          PointLocationReference pointLoc = xmlLoc.getPointLocationReference();
          /** DLR e.V. (LTouk) XML area location reference */
          AreaLocationReference areaLoc = xmlLoc.getAreaLocationReference();
  
          if (lineLoc == null && pointLoc == null && areaLoc == null) {
              throw new OpenLRXMLException(XMLErrorType.DATA_ERROR,
                      "no location reference");
          }
  
          RawLocationReference rawLocRef = null;
          if (lineLoc != null) {
              LineDecoder decoder = new LineDecoder();
              rawLocRef = decoder.decodeData(id, lineLoc);
          } else if (pointLoc != null) {
              GeoCoordinate gCoord = pointLoc.getGeoCoordinate();
              PointAlongLine pal = pointLoc.getPointAlongLine();
              PoiWithAccessPoint palwap = pointLoc.getPoiWithAccessPoint();
              if (gCoord == null && pal == null && palwap == null) {
                  throw new OpenLRXMLException(XMLErrorType.DATA_ERROR,
                          "no point location found");
              }
              if (gCoord != null) {
                  GeoCoordDecoder decoder = new GeoCoordDecoder();
                  rawLocRef = decoder.decodeData(id, gCoord);
              } else if (pal != null) {
                  PointAlongDecoder decoder = new PointAlongDecoder();
                  rawLocRef = decoder.decodeData(id, pal);
              } else if (palwap != null) {
                  PoiAccessDecoder decoder = new PoiAccessDecoder();
                  rawLocRef = decoder.decodeData(id, palwap);
              }
          } else if (areaLoc != null) {
              /** DLR e.V. (LTouk) XML circle location reference */
              CircleLocationReference circleLoc = areaLoc
                      .getCircleLocationReference();
              RectangleLocationReference rectangleLoc = areaLoc
                      .getRectangleLocationReference();
              GridLocationReference gridLoc = areaLoc.getGridLocationReference();
              PolygonLocationReference polygonLoc = areaLoc
                      .getPolygonLocationReference();
              ClosedLineLocationReference closedLineLoc = areaLoc
                      .getClosedLineLocationReference();
  
              if (circleLoc == null && polygonLoc == null && rectangleLoc == null
                      && gridLoc == null && closedLineLoc == null) {
                  throw new OpenLRXMLException(XMLErrorType.DATA_ERROR,
                          "no area location found");
              }
              if (circleLoc != null) {
                  CircleDecoder circleDecoder = new CircleDecoder();
                  rawLocRef = circleDecoder.decodeData(id, circleLoc);
              } else if (rectangleLoc != null) {
                  RectangleDecoder rectangleDecoder = new RectangleDecoder();
                  rawLocRef = rectangleDecoder.decodeData(id, rectangleLoc);
              } else if (gridLoc != null) {
                  GridDecoder gridDecoder = new GridDecoder();
                  rawLocRef = gridDecoder.decodeData(id, gridLoc);
              } else if (polygonLoc != null) {
                  PolygonDecoder polygonDecoder = new PolygonDecoder();
                  rawLocRef = polygonDecoder.decodeData(id, polygonLoc);
              } else if (closedLineLoc != null) {
                  ClosedLineDecoder closedLineDecoder = new ClosedLineDecoder();
                  rawLocRef = closedLineDecoder.decodeData(id, closedLineLoc);
              }
  
          }
  
          return rawLocRef;
      }
focal_method.class_method_signature: OpenLRXMLDecoder.decodeData(final LocationReference lr)
focal_method.full_signature: @Override public final RawLocationReference decodeData(final LocationReference lr)
focal_method.identifier: decodeData
focal_method.invocations: getLocationReferenceData getLocationID getXMLLocationReference getLineLocationReference getPointLocationReference getAreaLocationReference decodeData getGeoCoordinate getPointAlongLine getPoiWithAccessPoint decodeData decodeData decodeData getCircleLocationReference getRectangleLocationReference getGridLocationReference getPolygonLocationReference getClosedLineLocationReference decodeData decodeData decodeData decodeData decodeData
focal_method.modifiers: @Override public final
focal_method.parameters: (final LocationReference lr)
focal_method.return: RawLocationReference
focal_method.signature: RawLocationReference decodeData(final LocationReference lr)