01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package org.apache.commons.betwixt.io;
18:
19: /** <p>Interface allowing pluggable <code>ID</code> attribute value generators.</p>
20: *
21: * <p> <code>IDGenerator</code>'s are used to generate <code>ID</code>
22: * attribute values by <code>BeanWriter</code>.
23: * A user can specify the generation mechanism by passing an implementation to
24: * {@link BeanWriter#setIdGenerator}.</p>
25: *
26: * <p>Standard implementations are included with that supply random and sequantial values.</p>
27: *
28: * @author <a href="mailto:rdonkin@apache.org">Robert Burrell Donkin</a>
29: * @version $Revision: 438373 $
30: */
31: public interface IDGenerator {
32:
33: /**
34: * Get the last <code>ID</code> value generated.
35: *
36: * @return the last value generated
37: */
38: public String getLastId();
39:
40: /**
41: * Generate a new <code>ID</code> attribute value.
42: *
43: * @return next value
44: */
45: public String nextId();
46: }
|