snmap-developer Mailing List for snmap (Page 4)
Status: Planning
Brought to you by:
arden
You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(5) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(23) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
(2) |
| 2007 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2008 |
Jan
|
Feb
(3) |
Mar
(2) |
Apr
(3) |
May
(2) |
Jun
(1) |
Jul
(5) |
Aug
(3) |
Sep
(11) |
Oct
(10) |
Nov
(23) |
Dec
(36) |
| 2009 |
Jan
(9) |
Feb
(13) |
Mar
(11) |
Apr
(21) |
May
(37) |
Jun
(21) |
Jul
(22) |
Aug
(7) |
Sep
(1) |
Oct
(1) |
Nov
|
Dec
(15) |
| 2010 |
Jan
(8) |
Feb
(6) |
Mar
(1) |
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(4) |
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
(3) |
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
(1) |
|
From: arden l. <ar...@us...> - 2006-01-13 03:17:00
|
Update of /cvsroot/snmap/SNMAP/src/net/sf/snmap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6628/src/net/sf/snmap Added Files: PropertyAccessException.java Log Message: --- NEW FILE: PropertyAccessException.java --- package net.sf.snmap; import net.sf.snmap.util.StringHelper; /** * A problem occurred accessing a property of an instance of a * persistent class by reflection, or via CGLIB. There are a * number of possible underlying causes, including * <ul> * <li>failure of a security check * <li>an exception occurring inside the getter or setter method * <li>a nullable database column was mapped to a primitive-type property * <li>the Hibernate type was not castable to the property type (or vice-versa) * </ul> * @author Gavin King */ public class PropertyAccessException extends SnmapException { private static final long serialVersionUID = 4947808644643754386L; private final Class persistentClass; private final String propertyName; private final boolean wasSetter; public PropertyAccessException(Throwable root, String s, boolean wasSetter, Class persistentClass, String propertyName) { super(s, root); this.persistentClass = persistentClass; this.wasSetter = wasSetter; this.propertyName = propertyName; } public Class getPersistentClass() { return persistentClass; } public String getPropertyName() { return propertyName; } public String getMessage() { return super.getMessage() + ( wasSetter ? " setter of " : " getter of ") + StringHelper.qualify( persistentClass.getName(), propertyName ); } } |
|
From: arden l. <ar...@us...> - 2006-01-13 03:16:24
|
Update of /cvsroot/snmap/SNMAP/src/net/sf/snmap/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6522/src/net/sf/snmap/util Added Files: StringHelper.java Log Message: --- NEW FILE: StringHelper.java --- //$Id$ package net.sf.snmap.util; import java.util.Iterator; import java.util.StringTokenizer; public final class StringHelper { private static final int ALIAS_TRUNCATE_LENGTH = 10; public static final String WHITESPACE = " \n\r\f\t"; private StringHelper() { /* static methods only - hide constructor */ } /*public static boolean containsDigits(String string) { for ( int i=0; i<string.length(); i++ ) { if ( Character.isDigit( string.charAt(i) ) ) return true; } return false; }*/ public static int lastIndexOfLetter(String string) { for ( int i=0; i<string.length(); i++ ) { char character = string.charAt(i); if ( !Character.isLetter(character) /*&& !('_'==character)*/ ) return i-1; } return string.length()-1; } public static String join(String seperator, String[] strings) { int length = strings.length; if ( length == 0 ) return ""; StringBuffer buf = new StringBuffer( length * strings[0].length() ) .append( strings[0] ); for ( int i = 1; i < length; i++ ) { buf.append( seperator ).append( strings[i] ); } return buf.toString(); } public static String join(String seperator, Iterator objects) { StringBuffer buf = new StringBuffer(); if ( objects.hasNext() ) buf.append( objects.next() ); while ( objects.hasNext() ) { buf.append( seperator ).append( objects.next() ); } return buf.toString(); } public static String[] add(String[] x, String sep, String[] y) { String[] result = new String[x.length]; for ( int i = 0; i < x.length; i++ ) { result[i] = x[i] + sep + y[i]; } return result; } public static String repeat(String string, int times) { StringBuffer buf = new StringBuffer( string.length() * times ); for ( int i = 0; i < times; i++ ) buf.append( string ); return buf.toString(); } public static String replace(String template, String placeholder, String replacement) { return replace( template, placeholder, replacement, false ); } public static String[] replace(String templates[], String placeholder, String replacement) { String[] result = new String[templates.length]; for ( int i =0; i<templates.length; i++ ) { result[i] = replace( templates[i], placeholder, replacement );; } return result; } public static String replace(String template, String placeholder, String replacement, boolean wholeWords) { int loc = template.indexOf( placeholder ); if ( loc < 0 ) { return template; } else { final boolean actuallyReplace = !wholeWords || loc + placeholder.length() == template.length() || !Character.isJavaIdentifierPart( template.charAt( loc + placeholder.length() ) ); String actualReplacement = actuallyReplace ? replacement : placeholder; return new StringBuffer( template.substring( 0, loc ) ) .append( actualReplacement ) .append( replace( template.substring( loc + placeholder.length() ), placeholder, replacement, wholeWords ) ).toString(); } } public static String replaceOnce(String template, String placeholder, String replacement) { int loc = template.indexOf( placeholder ); if ( loc < 0 ) { return template; } else { return new StringBuffer( template.substring( 0, loc ) ) .append( replacement ) .append( template.substring( loc + placeholder.length() ) ) .toString(); } } public static String[] split(String seperators, String list) { return split( seperators, list, false ); } public static String[] split(String seperators, String list, boolean include) { StringTokenizer tokens = new StringTokenizer( list, seperators, include ); String[] result = new String[ tokens.countTokens() ]; int i = 0; while ( tokens.hasMoreTokens() ) { result[i++] = tokens.nextToken(); } return result; } public static String unqualify(String qualifiedName) { return qualifiedName.substring( qualifiedName.lastIndexOf(".") + 1 ); } public static String qualifier(String qualifiedName) { int loc = qualifiedName.lastIndexOf("."); return ( loc < 0 ) ? "" : qualifiedName.substring( 0, loc ); } public static String[] suffix(String[] columns, String suffix) { if ( suffix == null ) return columns; String[] qualified = new String[columns.length]; for ( int i = 0; i < columns.length; i++ ) { qualified[i] = suffix( columns[i], suffix ); } return qualified; } private static String suffix(String name, String suffix) { return ( suffix == null ) ? name : name + suffix; } public static String root(String qualifiedName) { int loc = qualifiedName.indexOf( "." ); return ( loc < 0 ) ? qualifiedName : qualifiedName.substring( 0, loc ); } public static String unroot(String qualifiedName) { int loc = qualifiedName.indexOf( "." ); return ( loc < 0 ) ? qualifiedName : qualifiedName.substring( loc+1, qualifiedName.length() ); } public static boolean booleanValue(String tfString) { String trimmed = tfString.trim().toLowerCase(); return trimmed.equals( "true" ) || trimmed.equals( "t" ); } public static String toString(Object[] array) { int len = array.length; if ( len == 0 ) return ""; StringBuffer buf = new StringBuffer( len * 12 ); for ( int i = 0; i < len - 1; i++ ) { buf.append( array[i] ).append(", "); } return buf.append( array[len - 1] ).toString(); } public static String[] multiply(String string, Iterator placeholders, Iterator replacements) { String[] result = new String[]{string}; while ( placeholders.hasNext() ) { result = multiply( result, ( String ) placeholders.next(), ( String[] ) replacements.next() ); } return result; } private static String[] multiply(String[] strings, String placeholder, String[] replacements) { String[] results = new String[replacements.length * strings.length]; int n = 0; for ( int i = 0; i < replacements.length; i++ ) { for ( int j = 0; j < strings.length; j++ ) { results[n++] = replaceOnce( strings[j], placeholder, replacements[i] ); } } return results; } public static int countUnquoted(String string, char character) { if ( '\'' == character ) { throw new IllegalArgumentException( "Unquoted count of quotes is invalid" ); } if (string == null) return 0; // Impl note: takes advantage of the fact that an escpaed single quote // embedded within a quote-block can really be handled as two seperate // quote-blocks for the purposes of this method... int count = 0; int stringLength = string.length(); boolean inQuote = false; for ( int indx = 0; indx < stringLength; indx++ ) { char c = string.charAt( indx ); if ( inQuote ) { if ( '\'' == c ) { inQuote = false; } } else if ( '\'' == c ) { inQuote = true; } else if ( c == character ) { count++; } } return count; } public static boolean isNotEmpty(String string) { return string != null && string.length() > 0; } public static boolean isEmpty(String string) { return string == null || string.length() == 0; } public static String qualify(String prefix, String name) { if ( name == null || prefix == null ) { throw new NullPointerException(); } return new StringBuffer( prefix.length() + name.length() + 1 ) .append(prefix) .append('.') .append(name) .toString(); } public static String[] qualify(String prefix, String[] names) { if ( prefix == null ) return names; int len = names.length; String[] qualified = new String[len]; for ( int i = 0; i < len; i++ ) { qualified[i] = qualify( prefix, names[i] ); } return qualified; } public static int firstIndexOfChar(String sqlString, String string, int startindex) { int matchAt = -1; for ( int i = 0; i < string.length(); i++ ) { int curMatch = sqlString.indexOf( string.charAt( i ), startindex ); if ( curMatch >= 0 ) { if ( matchAt == -1 ) { // first time we find match! matchAt = curMatch; } else { matchAt = Math.min( matchAt, curMatch ); } } } return matchAt; } public static String truncate(String string, int length) { if ( string.length() <= length ) { return string; } else { return string.substring( 0, length ); } } /** * Generate a nice alias for the given class name or collection role * name and unique integer. Subclasses of Loader do <em>not</em> have * to use aliases of this form. * @return an alias of the form <tt>foo1_</tt> */ public static String generateAlias(String description, int unique) { return generateAliasRoot(description) + Integer.toString(unique) + '_'; } private static String generateAliasRoot(String description) { final String result = truncate( unqualifyEntityName(description), ALIAS_TRUNCATE_LENGTH ) .toLowerCase() .replace( '/', '_' ) // entityNames may now include slashes for the representations .replace( '$', '_' ); //classname may be an inner class if ( Character.isDigit( result.charAt(result.length()-1) ) ) { return result + "x"; //ick! } else { return result; } } public static String unqualifyEntityName(String entityName) { String result = unqualify(entityName); int slashPos = result.indexOf( '/' ); if ( slashPos > 0 ) { result = result.substring( 0, slashPos - 1 ); } return result; } public static String generateAlias(String description) { return generateAliasRoot(description) + '_'; } public static String toUpperCase(String str) { return str==null ? null : str.toUpperCase(); } public static String toLowerCase(String str) { return str==null ? null : str.toLowerCase(); } public static String moveAndToBeginning(String filter) { if ( filter.trim().length()>0 ){ filter += " and "; if ( filter.startsWith(" and ") ) filter = filter.substring(4); } return filter; } } |
|
From: arden l. <ar...@us...> - 2006-01-13 03:14:30
|
Update of /cvsroot/snmap/SNMAP/lib/SNMP4J/1.6c In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6169/lib/SNMP4J/1.6c Removed Files: SNMP4J-1.6c.jar Log Message: --- SNMP4J-1.6c.jar DELETED --- |
|
From: arden l. <ar...@us...> - 2006-01-05 05:00:20
|
Update of /cvsroot/snmap/SNMAP/src/net/sf/snmap/cfg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12512/src/net/sf/snmap/cfg Modified Files: Mappings.java Log Message: Index: Mappings.java =================================================================== RCS file: /cvsroot/snmap/SNMAP/src/net/sf/snmap/cfg/Mappings.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Mappings.java 16 Dec 2005 04:37:01 -0000 1.1 --- Mappings.java 5 Jan 2006 05:00:10 -0000 1.2 *************** *** 2,9 **** --- 2,14 ---- import java.io.Serializable; + import java.util.Map; + + import net.sf.snmap.MappingException; + import net.sf.snmap.mapping.PersistentClass; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; + /** * A collection of mappings from classes and collections to relational database *************** *** 15,18 **** --- 20,56 ---- private static final Log log = LogFactory.getLog(Mappings.class); + + /** + * Default package name of one xml mapping file. + */ + private String defaultPackage; + + /** + * Keep classname and class information into Map. + */ + private Map<String, PersistentClass> classes; + + /** + * @return -- Returns the defaultPackage. + */ + public String getDefaultPackage() { + return defaultPackage; + } + + /** + * @param defaultPackage -- The defaultPackage to set. + */ + public void setDefaultPackage( String defaultPackage ) { + this.defaultPackage = defaultPackage; + } + /** + * Add PersistentClass instance into Map. + * @param persistentClass + * @throws MappingException + */ + public void addClass(PersistentClass persistentClass) throws MappingException { + Object old = classes.put( persistentClass.getClassName(), persistentClass ); + if ( old!=null ) log.warn( "duplicate class mapping: " + persistentClass.getClassName() ); + } } \ No newline at end of file |
|
From: arden l. <ar...@us...> - 2006-01-05 04:06:22
|
Update of /cvsroot/snmap/SNMAP/src/net/sf/snmap/mapping In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3364/src/net/sf/snmap/mapping Added Files: RootClass.java Log Message: --- NEW FILE: RootClass.java --- package net.sf.snmap.mapping; public class RootClass extends PersistentClass { private static final long serialVersionUID = -7658578563065461305L; } |
|
From: arden l. <ar...@us...> - 2006-01-05 04:03:30
|
Update of /cvsroot/snmap/SNMAP/src/net/sf/snmap/mapping In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2430/src/net/sf/snmap/mapping Added Files: PersistentClass.java Log Message: --- NEW FILE: PersistentClass.java --- package net.sf.snmap.mapping; import java.io.Serializable; import java.util.ArrayList; /** * Mapping for an entity. */ public abstract class PersistentClass implements Serializable { /** * Class Name. */ private String className; private ArrayList<Property> properties = new ArrayList<Property>(); public String getClassName() { return className; } public void setClassName(String className) { this.className = className==null ? null : className.intern(); } public void addProperty(Property p) { properties.add(p); p.setPersistentClass(this); } } |
|
From: arden l. <ar...@us...> - 2006-01-05 03:58:19
|
Update of /cvsroot/snmap/SNMAP/src/net/sf/snmap/mapping In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv646/src/net/sf/snmap/mapping Modified Files: Property.java Log Message: Index: Property.java =================================================================== RCS file: /cvsroot/snmap/SNMAP/src/net/sf/snmap/mapping/Property.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Property.java 10 Dec 2005 06:12:15 -0000 1.1 --- Property.java 5 Jan 2006 03:58:09 -0000 1.2 *************** *** 14,17 **** --- 14,20 ---- private OID oid; private Access access; + + // TODO: from hibernate. + private PersistentClass persistentClass; public String getName() *************** *** 44,46 **** --- 47,59 ---- this.access = access; } + + + // TODO : From hibernate. + public PersistentClass getPersistentClass() { + return persistentClass; + } + + public void setPersistentClass(PersistentClass persistentClass) { + this.persistentClass = persistentClass; + } } |
|
From: arden l. <ar...@us...> - 2005-12-23 23:51:11
|
Update of /cvsroot/snmap/SNMAP/src/net/sf/snmap/cfg In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8112/src/net/sf/snmap/cfg Modified Files: Configuration.java Log Message: Index: Configuration.java =================================================================== RCS file: /cvsroot/snmap/SNMAP/src/net/sf/snmap/cfg/Configuration.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Configuration.java 10 Dec 2005 06:12:15 -0000 1.1 --- Configuration.java 23 Dec 2005 23:51:02 -0000 1.2 *************** *** 20,23 **** --- 20,24 ---- import net.sf.snmap.MappingException; import net.sf.snmap.SnmapException; + import net.sf.snmap.util.CollectionHelper; import net.sf.snmap.util.XMLHelper; *************** *** 38,44 **** --- 39,54 ---- */ public Configuration() { + init(); } /** + * Initiate class member. + */ + protected void init() { + xmlHelper = new XMLHelper(); + properties = Environment.getProperties(); + } + + /** * * @param url *************** *** 179,183 **** throws MappingException { try { ! List errors = new ArrayList(); org.dom4j.Document doc = xmlHelper.createSAXReader( "XML InputStream", errors).read( --- 189,193 ---- throws MappingException { try { ! List<SAXParseException> errors = new ArrayList<SAXParseException>(); org.dom4j.Document doc = xmlHelper.createSAXReader( "XML InputStream", errors).read( *************** *** 186,191 **** throw new MappingException("invalid mapping", (Throwable) errors.get(0)); ! // TODO : ! // add( doc ); return this; } catch (MappingException me) { --- 196,200 ---- throw new MappingException("invalid mapping", (Throwable) errors.get(0)); ! add( doc ); return this; } catch (MappingException me) { *************** *** 202,204 **** --- 211,231 ---- } } + + protected void add(org.dom4j.Document doc) throws MappingException { + try { + SnmapBinder.bindRoot( doc, createMappings(), CollectionHelper.EMPTY_MAP ); // TODO: possibly get inheritable meta's from cfg.xml + } + catch ( MappingException me ) { + log.error( "Could not compile the mapping document", me ); + throw me; + } + } + + /** + * Create a new <tt>Mappings</tt> to add class and collection + * mappings to. + */ + public Mappings createMappings() { + return new Mappings(); + } } |
|
From: arden l. <ard...@ya...> - 2005-12-23 04:01:06
|
test snmap-developer. --------------------------------- Yahoo! Photos Ring in the New Year with Photo Calendars. Add photos, events, holidays, whatever. |
|
From: arden l. <ar...@us...> - 2005-12-23 04:00:17
|
Update of /cvsroot/snmap/SNMAP/src/net/sf/snmap/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8951/src/net/sf/snmap/util Added Files: CollectionHelper.java Log Message: --- NEW FILE: CollectionHelper.java --- package net.sf.snmap.util; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; public final class CollectionHelper { public static final List EMPTY_LIST = Collections.unmodifiableList( new ArrayList(0) ); public static final Collection EMPTY_COLLECTION = Collections.unmodifiableCollection( new ArrayList(0) ); public static final Map EMPTY_MAP = Collections.unmodifiableMap( new HashMap(0) ); private CollectionHelper() {} } |
|
From: arden l. <ard...@ya...> - 2005-12-10 16:08:54
|
setestse --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping |
|
From: arden l. <ard...@ya...> - 2005-12-10 15:55:04
|
test --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping |