* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-package org.opendaylight.yangtools.yang.model.repo.api;
+package org.opendaylight.yangtools.yang.model.spi.source;
import static java.util.Objects.requireNonNull;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
-import java.util.Optional;
import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.yangtools.concepts.Delegator;
+import org.opendaylight.yangtools.yang.model.api.source.SourceIdentifier;
/**
- * A {@link YangTextSchemaSource} backed by a file.
- *
- * @author Robert Varga
+ * A {@link YangTextSource} backed by a file.
*/
-final class YangTextFileSchemaSource extends YangTextSchemaSource implements Delegator<Path> {
+final class YangTextFileSource extends YangTextSource implements Delegator<Path> {
private final @NonNull Path path;
private final @NonNull Charset charset;
- YangTextFileSchemaSource(final SourceIdentifier identifier, final Path path, final Charset charset) {
- super(identifier);
+ YangTextFileSource(final SourceIdentifier sourceId, final Path path, final Charset charset) {
+ super(sourceId);
this.path = requireNonNull(path);
this.charset = requireNonNull(charset);
}
}
@Override
- public Optional<String> getSymbolicName() {
+ public String symbolicName() {
// FIXME: NEXT: this is forcing internal normalization. I think this boils down to providing Path back, which
// is essentially getDelegate() anyway. Perhaps expose it as PathAware?
- return Optional.of(path.toString());
+ return path.toString();
}
}