Author: koji
Date: Sat Jan 9 01:50:48 2010
New Revision: 897366
URL: http://svn.apache.org/viewvc?rev=897366&view=rev
Log:
fix svn properties in core package
Modified:
lucene/solr/trunk/src/java/org/apache/solr/core/CloseHook.java (props
changed)
lucene/solr/trunk/src/java/org/apache/solr/core/DirectoryFactory.java
(props changed)
lucene/solr/trunk/src/java/org/apache/solr/core/JmxMonitoredMap.java
(props changed)
lucene/solr/trunk/src/java/org/apache/solr/core/PluginInfo.java
(contents, props changed)
lucene/solr/trunk/src/java/org/apache/solr/core/StandardDirectoryFactory.java
(props changed)
lucene/solr/trunk/src/java/org/apache/solr/core/StandardIndexReaderFactory.java
(props changed)
Propchange: lucene/solr/trunk/src/java/org/apache/solr/core/CloseHook.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL
Propchange:
lucene/solr/trunk/src/java/org/apache/solr/core/DirectoryFactory.java
('svn:executable' removed)
Propchange: lucene/solr/trunk/src/java/org/apache/solr/core/JmxMonitoredMap.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: lucene/solr/trunk/src/java/org/apache/solr/core/PluginInfo.java
URL:
http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/core/PluginInfo.java?rev=897366&r1=897365&r2=897366&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/core/PluginInfo.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/core/PluginInfo.java Sat Jan 9
01:50:48 2010
@@ -1,107 +1,107 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.solr.core;
-
-import org.apache.solr.common.util.NamedList;
-import org.apache.solr.common.util.DOMUtil;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.util.*;
-import static java.util.Collections.unmodifiableList;
-import static java.util.Collections.unmodifiableMap;
-
-/**
- * An Object which represents a Plugin of any type
- * @version $Id$
- */
-public class PluginInfo {
- public final String name, className, type;
- public final NamedList initArgs;
- public final Map<String, String> attributes;
- public final List<PluginInfo> children;
-
- public PluginInfo(String type, Map<String, String> attrs ,NamedList
initArgs, List<PluginInfo> children) {
- this.type = type;
- this.name = attrs.get("name");
- this.className = attrs.get("class");
- this.initArgs = initArgs;
- attributes = unmodifiableMap(attrs);
- this.children = children == null ? Collections.<PluginInfo>emptyList():
unmodifiableList(children);
- }
-
-
- public PluginInfo(Node node, String err, boolean requireName, boolean
requireClass) {
- type = node.getNodeName();
- name = DOMUtil.getAttr(node, "name", requireName ? err : null);
- className = DOMUtil.getAttr(node, "class", requireClass ? err : null);
- initArgs = DOMUtil.childNodesToNamedList(node);
- attributes = unmodifiableMap(DOMUtil.toMap(node.getAttributes()));
- children = loadSubPlugins(node);
- }
-
- private List<PluginInfo> loadSubPlugins(Node node) {
- List<PluginInfo> children = new ArrayList<PluginInfo>();
- //if there is another sub tag with a non namedlist tag that has to be
another plugin
- NodeList nlst = node.getChildNodes();
- for (int i = 0; i < nlst.getLength(); i++) {
- Node nd = nlst.item(i);
- if (nd.getNodeType() != Node.ELEMENT_NODE) continue;
- if (NL_TAGS.contains(nd.getNodeName())) continue;
- PluginInfo pluginInfo = new PluginInfo(nd, null, false, false);
- if (pluginInfo.isEnabled()) children.add(pluginInfo);
- }
- return children.isEmpty() ? Collections.<PluginInfo>emptyList() :
unmodifiableList(children);
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder("{");
- if (type != null) sb.append("type = " + type + ",");
- if (name != null) sb.append("name = " + name + ",");
- if (className != null) sb.append("class = " + className + ",");
- if (initArgs.size() > 0) sb.append("args = " + initArgs);
- sb.append("}");
- return sb.toString();
- }
-
- public boolean isEnabled(){
- String enable = attributes.get("enable");
- return enable == null || Boolean.parseBoolean(enable);
- }
-
- public boolean isDefault() {
- return Boolean.parseBoolean(attributes.get("default"));
- }
-
- public PluginInfo getChild(String type){
- List<PluginInfo> l = getChildren(type);
- return l.isEmpty() ? null:l.get(0);
- }
-
- /**Filter children by type
- * @param type The type name. must not be null
- * @return The mathcing children
- */
- public List<PluginInfo> getChildren(String type){
- if(children.isEmpty()) return children;
- List<PluginInfo> result = new ArrayList<PluginInfo>();
- for (PluginInfo child : children) if(type.equals(child.type))
result.add(child);
- return result;
- }
- private static final HashSet<String> NL_TAGS = new
HashSet<String>(Arrays.asList("lst","str","int","bool","arr","float","double"));
-}
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.core;
+
+import org.apache.solr.common.util.NamedList;
+import org.apache.solr.common.util.DOMUtil;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import java.util.*;
+import static java.util.Collections.unmodifiableList;
+import static java.util.Collections.unmodifiableMap;
+
+/**
+ * An Object which represents a Plugin of any type
+ * @version $Id$
+ */
+public class PluginInfo {
+ public final String name, className, type;
+ public final NamedList initArgs;
+ public final Map<String, String> attributes;
+ public final List<PluginInfo> children;
+
+ public PluginInfo(String type, Map<String, String> attrs ,NamedList
initArgs, List<PluginInfo> children) {
+ this.type = type;
+ this.name = attrs.get("name");
+ this.className = attrs.get("class");
+ this.initArgs = initArgs;
+ attributes = unmodifiableMap(attrs);
+ this.children = children == null ? Collections.<PluginInfo>emptyList():
unmodifiableList(children);
+ }
+
+
+ public PluginInfo(Node node, String err, boolean requireName, boolean
requireClass) {
+ type = node.getNodeName();
+ name = DOMUtil.getAttr(node, "name", requireName ? err : null);
+ className = DOMUtil.getAttr(node, "class", requireClass ? err : null);
+ initArgs = DOMUtil.childNodesToNamedList(node);
+ attributes = unmodifiableMap(DOMUtil.toMap(node.getAttributes()));
+ children = loadSubPlugins(node);
+ }
+
+ private List<PluginInfo> loadSubPlugins(Node node) {
+ List<PluginInfo> children = new ArrayList<PluginInfo>();
+ //if there is another sub tag with a non namedlist tag that has to be
another plugin
+ NodeList nlst = node.getChildNodes();
+ for (int i = 0; i < nlst.getLength(); i++) {
+ Node nd = nlst.item(i);
+ if (nd.getNodeType() != Node.ELEMENT_NODE) continue;
+ if (NL_TAGS.contains(nd.getNodeName())) continue;
+ PluginInfo pluginInfo = new PluginInfo(nd, null, false, false);
+ if (pluginInfo.isEnabled()) children.add(pluginInfo);
+ }
+ return children.isEmpty() ? Collections.<PluginInfo>emptyList() :
unmodifiableList(children);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder("{");
+ if (type != null) sb.append("type = " + type + ",");
+ if (name != null) sb.append("name = " + name + ",");
+ if (className != null) sb.append("class = " + className + ",");
+ if (initArgs.size() > 0) sb.append("args = " + initArgs);
+ sb.append("}");
+ return sb.toString();
+ }
+
+ public boolean isEnabled(){
+ String enable = attributes.get("enable");
+ return enable == null || Boolean.parseBoolean(enable);
+ }
+
+ public boolean isDefault() {
+ return Boolean.parseBoolean(attributes.get("default"));
+ }
+
+ public PluginInfo getChild(String type){
+ List<PluginInfo> l = getChildren(type);
+ return l.isEmpty() ? null:l.get(0);
+ }
+
+ /**Filter children by type
+ * @param type The type name. must not be null
+ * @return The mathcing children
+ */
+ public List<PluginInfo> getChildren(String type){
+ if(children.isEmpty()) return children;
+ List<PluginInfo> result = new ArrayList<PluginInfo>();
+ for (PluginInfo child : children) if(type.equals(child.type))
result.add(child);
+ return result;
+ }
+ private static final HashSet<String> NL_TAGS = new
HashSet<String>(Arrays.asList("lst","str","int","bool","arr","float","double"));
+}
Propchange: lucene/solr/trunk/src/java/org/apache/solr/core/PluginInfo.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
lucene/solr/trunk/src/java/org/apache/solr/core/StandardDirectoryFactory.java
('svn:executable' removed)
Propchange:
lucene/solr/trunk/src/java/org/apache/solr/core/StandardIndexReaderFactory.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
lucene/solr/trunk/src/java/org/apache/solr/core/StandardIndexReaderFactory.java
------------------------------------------------------------------------------
svn:keywords = Date Author Id Revision HeadURL