001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package org.apache.cocoon.components.search;
018:
019: import org.xml.sax.Attributes;
020:
021: /**
022: * A helper class for generating a lucene document in a SAX ContentHandler.
023: *
024: * @author <a href="mailto:berni_huber@a1.net">Bernhard Huber</a>
025: * @version CVS $Id: IndexHelperField.java 433543 2006-08-22 06:22:54Z crossley $
026: */
027: class IndexHelperField {
028: String localFieldName;
029: String qualifiedFieldName;
030: StringBuffer text;
031: Attributes attributes;
032:
033: /**
034: *Constructor for the IndexHelperField object
035: *
036: * @param lfn Description of Parameter
037: * @param qfn Description of Parameter
038: * @param atts Description of Parameter
039: * @since
040: */
041: IndexHelperField(String lfn, String qfn, Attributes atts) {
042: this .localFieldName = lfn;
043: this .qualifiedFieldName = qfn;
044: this .attributes = atts;
045: this .text = new StringBuffer();
046: }
047:
048: /**
049: *Gets the localFieldName attribute of the IndexHelperField object
050: *
051: * @return The localFieldName value
052: * @since
053: */
054: public String getLocalFieldName() {
055: return localFieldName;
056: }
057:
058: /**
059: *Gets the qualifiedFieldName attribute of the IndexHelperField object
060: *
061: * @return The qualifiedFieldName value
062: * @since
063: */
064: public String getQualifiedFieldName() {
065: return qualifiedFieldName;
066: }
067:
068: /**
069: *Gets the attributes attribute of the IndexHelperField object
070: *
071: * @return The attributes value
072: * @since
073: */
074: public Attributes getAttributes() {
075: return attributes;
076: }
077:
078: /**
079: *Gets the text attribute of the IndexHelperField object
080: *
081: * @return The text value
082: * @since
083: */
084: public StringBuffer getText() {
085: return text;
086: }
087:
088: /**
089: *Description of the Method
090: *
091: * @param text Description of Parameter
092: * @since
093: */
094: public void appendText(String text) {
095: this .text.append(text);
096: }
097:
098: /**
099: *Description of the Method
100: *
101: * @param str Description of Parameter
102: * @param offset Description of Parameter
103: * @param length Description of Parameter
104: * @since
105: */
106: public void appendText(char[] str, int offset, int length) {
107: this.text.append(str, offset, length);
108: }
109: }
|