mirror of
https://github.com/lightbend/config.git
synced 2025-03-28 13:01:09 +08:00
Add docs and copyright information
Add copyright information to all ConfigNode classes. Document the ConfigNode interface.
This commit is contained in:
parent
cce8c204ac
commit
0a804deff5
@ -1,5 +1,27 @@
|
||||
/**
|
||||
* Copyright (C) 2015 Typesafe Inc. <http://typesafe.com>
|
||||
*/
|
||||
package com.typesafe.config;
|
||||
|
||||
/**
|
||||
* An immutable node that makes up the ConfigDocument AST, and which can be
|
||||
* used to reproduce part or all of the original text of an input.
|
||||
*
|
||||
* <p>
|
||||
* Because this object is immutable, it is safe to use from multiple threads and
|
||||
* there's no need for "defensive copies."
|
||||
*
|
||||
* <p>
|
||||
* <em>Do not implement interface {@code ConfigNode}</em>; it should only be
|
||||
* implemented by the config library. Arbitrary implementations will not work
|
||||
* because the library internals assume a specific concrete implementation.
|
||||
* Also, this interface is likely to grow new methods over time, so third-party
|
||||
* implementations will break.
|
||||
*/
|
||||
public interface ConfigNode {
|
||||
/**
|
||||
* The original text of the input which was used to form this particular node.
|
||||
* @return the original text used to form this node as a String
|
||||
*/
|
||||
public String render();
|
||||
}
|
||||
|
@ -1,3 +1,6 @@
|
||||
/**
|
||||
* Copyright (C) 2015 Typesafe Inc. <http://typesafe.com>
|
||||
*/
|
||||
package com.typesafe.config.impl;
|
||||
|
||||
import com.typesafe.config.ConfigNode;
|
||||
|
@ -1,7 +1,9 @@
|
||||
/**
|
||||
* Copyright (C) 2015 Typesafe Inc. <http://typesafe.com>
|
||||
*/
|
||||
package com.typesafe.config.impl;
|
||||
|
||||
// This is gross. We currently have a class that doesn't do anything, but is needed
|
||||
// to distinguish certain types of nodes from other types. This is required if we want
|
||||
// This is required if we want
|
||||
// to be referencing the AbstractConfigNode class in implementation rather than the
|
||||
// ConfigNode interface, as we can't cast an AbstractConfigNode to an interface
|
||||
abstract class AbstractConfigNodeValue extends AbstractConfigNode {
|
||||
|
@ -1,3 +1,6 @@
|
||||
/**
|
||||
* Copyright (C) 2015 Typesafe Inc. <http://typesafe.com>
|
||||
*/
|
||||
package com.typesafe.config.impl;
|
||||
|
||||
import com.typesafe.config.ConfigNode;
|
||||
|
@ -1,3 +1,6 @@
|
||||
/**
|
||||
* Copyright (C) 2015 Typesafe Inc. <http://typesafe.com>
|
||||
*/
|
||||
package com.typesafe.config.impl;
|
||||
|
||||
import java.util.Collection;
|
||||
|
@ -1,3 +1,6 @@
|
||||
/**
|
||||
* Copyright (C) 2015 Typesafe Inc. <http://typesafe.com>
|
||||
*/
|
||||
package com.typesafe.config.impl;
|
||||
|
||||
import com.typesafe.config.ConfigException;
|
||||
@ -6,7 +9,7 @@ import com.typesafe.config.ConfigNode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
public class ConfigNodeKeyValue extends AbstractConfigNode {
|
||||
final class ConfigNodeKeyValue extends AbstractConfigNode {
|
||||
final private ArrayList<AbstractConfigNode> children;
|
||||
|
||||
public ConfigNodeKeyValue(Collection<AbstractConfigNode> children) {
|
||||
|
@ -1,13 +1,13 @@
|
||||
/**
|
||||
* Copyright (C) 2015 Typesafe Inc. <http://typesafe.com>
|
||||
*/
|
||||
package com.typesafe.config.impl;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
/**
|
||||
* This class represents a leaf ConfigNode. This type of ConfigNode has no children.
|
||||
*/
|
||||
class ConfigNodeSimpleValue extends AbstractConfigNodeValue {
|
||||
Token token;
|
||||
final Token token;
|
||||
ConfigNodeSimpleValue(Token value) {
|
||||
token = value;
|
||||
}
|
||||
|
@ -1,10 +1,13 @@
|
||||
/**
|
||||
* Copyright (C) 2015 Typesafe Inc. <http://typesafe.com>
|
||||
*/
|
||||
package com.typesafe.config.impl;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
final class ConfigNodeSingleToken extends AbstractConfigNode{
|
||||
Token token;
|
||||
final Token token;
|
||||
ConfigNodeSingleToken(Token t) {
|
||||
token = t;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user