001/* 002 * ModeShape (http://www.modeshape.org) 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.modeshape.schematic.internal.document; 017 018import java.text.ParseException; 019import java.util.Date; 020import java.util.UUID; 021import java.util.regex.Pattern; 022import org.modeshape.schematic.document.Binary; 023import org.modeshape.schematic.document.Code; 024import org.modeshape.schematic.document.CodeWithScope; 025import org.modeshape.schematic.document.Document; 026import org.modeshape.schematic.document.ObjectId; 027import org.modeshape.schematic.document.Symbol; 028import org.modeshape.schematic.document.Timestamp; 029 030public interface DocumentValueFactory { 031 032 String createString(String value); 033 034 Integer createInt(int value); 035 036 Long createLong(long value); 037 038 Boolean createBoolean(boolean value); 039 040 Double createDouble(double value); 041 042 Date createDate(String iso) throws ParseException; 043 044 Date createDate(long millis); 045 046 Timestamp createTimestamp(int time, int inc); 047 048 ObjectId createObjectId(String hex); 049 050 ObjectId createObjectId(byte[] bytes); 051 052 ObjectId createObjectId(int time, int machine, int process, int inc); 053 054 Symbol createSymbol(String value); 055 056 Pattern createRegex(String pattern, String flags); 057 058 Pattern createRegex(String pattern, int flags); 059 060 Object createNull(); 061 062 Binary createBinary(byte type, byte[] data); 063 064 UUID createUuid(String uuid); 065 066 UUID createUuid(long part1, long part2); 067 068 Code createCode(String code); 069 070 CodeWithScope createCode(String code, Document scope); 071 072}