MCPcopy Create free account
hub / github.com/PCGen/pcgen / internalReadSources

Method internalReadSources

code/src/java/pcgen/io/PCGIOHandler.java:549–581  ·  view source on GitHub ↗
(InputStream in)

Source from the content-addressed store, hash-verified

547 }
548
549 @Nullable
550 private SourceSelectionFacade internalReadSources(InputStream in)
551 {
552 // Read lines from file
553 final List<String> lines = readPcgLines(in);
554
555 // Verify it is ver2
556 boolean isPCGVersion2 = isPCGCersion2(lines);
557
558 final String[] pcgLines = lines.toArray(new String[0]);
559
560 if (isPCGVersion2)
561 {
562 //PlayerCharacter aPC = new PlayerCharacter();
563 final PCGParser parser = new PCGVer2Parser(null);
564 try
565 {
566 // Extract list of sources
567 return parser.parcePCGSourceOnly(pcgLines);
568 } catch (PCGParseException pcgex)
569 {
570 errors.add(pcgex.getMessage() + Constants.LINE_SEPARATOR + "Method: " + pcgex.getMethod() + '\n'
571 + "Line: " + pcgex.getLine());
572 }
573
574 warnings.addAll(parser.getWarnings());
575 } else
576 {
577 errors.add("Cannot open PCG file");
578 }
579
580 return null;
581 }
582
583}

Callers 1

readSourcesMethod · 0.95

Calls 10

readPcgLinesMethod · 0.95
isPCGCersion2Method · 0.95
parcePCGSourceOnlyMethod · 0.95
getWarningsMethod · 0.95
getMethodMethod · 0.80
getLineMethod · 0.80
addMethod · 0.65
getMessageMethod · 0.65
addAllMethod · 0.65
toArrayMethod · 0.45

Tested by

no test coverage detected