Package org.kapott.hbci.datatypes

Examples of org.kapott.hbci.datatypes.SyntaxDE


        factories=new Hashtable<String, ObjectFactory>();
    }
   
    public SyntaxDE createSyntaxDE(String dataType,String path,String value,int minsize,int maxsize)
    {
        SyntaxDE ret=null;
        ObjectFactory factory;
       
        synchronized(this) {
          factory=factories.get(dataType);

          if (factory==null) {
            factory=new ObjectFactory(Integer.parseInt(HBCIUtils.getParam("kernel.objpool.Syntax","1024")));
            factories.put(dataType,factory);
          }
        }
       
        ret=(SyntaxDE)factory.getFreeObject();
        if (ret==null) {
            // laden der klasse, die die syntax des de enthaelt
            Class c;
            try {
                c=Class.forName("org.kapott.hbci.datatypes.Syntax"+dataType,false,this.getClass().getClassLoader());
            } catch (ClassNotFoundException e) {
                throw new NoSuchSyntaxException(dataType,path);
            }

            // holen des constructors fuer diese klasse
            Constructor con;
            try {
                con=c.getConstructor(new Class[]{String.class, int.class, int.class});
            } catch (NoSuchMethodException e) {
                throw new NoSuchConstructorException(dataType);
            }

            /* anlegen einer neuen instanz der syntaxklasse und initialisieren
             mit dem uebergebenen wert */
            try {
                ret=(SyntaxDE)(con.newInstance(new Object[]{value, new Integer(minsize), new Integer(maxsize)}));
            } catch (InstantiationException e) {
            } catch (IllegalAccessException e) {
            } catch (InvocationTargetException e) {
                throw new InitializingException((Exception)e.getCause(),path);
            }
           
            if (ret!=null) {
                factory.addToUsedPool(ret);
            }
        } else {
            try {
                ret.init(value,minsize,maxsize);
                factory.addToUsedPool(ret);
            } catch (RuntimeException e) {
                factory.addToFreePool(ret);
                throw new InitializingException(e,path);
            }
View Full Code Here


        return ret;
    }

    public SyntaxDE createSyntaxDE(String dataType,String path,StringBuffer res,int minsize,int maxsize)
    {
        SyntaxDE      ret=null;
        ObjectFactory factory;
       
        synchronized(this) {
          factory=factories.get(dataType);

          if (factory==null) {
            factory=new ObjectFactory(Integer.parseInt(HBCIUtils.getParam("kernel.objpool.Syntax","1024")));
            factories.put(dataType,factory);
          }
        }
       
        ret=(SyntaxDE)factory.getFreeObject();
        if (ret==null) {
            // laden der klasse, die die syntax des de enthaelt
            Class c;
            try {
                c=Class.forName("org.kapott.hbci.datatypes.Syntax"+dataType,false,this.getClass().getClassLoader());
            } catch (ClassNotFoundException e) {
                throw new NoSuchSyntaxException(dataType,path);
            }

            // holen des constructors fuer diese klasse
            Constructor con;
            try {
                con=c.getConstructor(new Class[]{StringBuffer.class, int.class, int.class});
            } catch (NoSuchMethodException e) {
                throw new NoSuchConstructorException(dataType);
            }

            /* anlegen einer neuen instanz der syntaxklasse und initialisieren
             mit dem uebergebenen wert */
            try {
                ret=(SyntaxDE)(con.newInstance(new Object[]{res, new Integer(minsize), new Integer(maxsize)}));
            } catch (InstantiationException e) {
            } catch (IllegalAccessException e) {
            } catch (InvocationTargetException e) {
                throw new ParseErrorException(HBCIUtilsInternal.getLocMsg("EXCMSG_PROT_ERRSYNDE",path),(Exception)e.getCause());
            }
           
            if (ret!=null) {
                factory.addToUsedPool(ret);
            }
        } else {
            try {
                ret.init(res,minsize,maxsize);
                factory.addToUsedPool(ret);
            } catch (RuntimeException e) {
                factory.addToFreePool(ret);
                throw new ParseErrorException(HBCIUtilsInternal.getLocMsg("EXCMSG_PROT_ERRSYNDE",path),(Exception)e.getCause());
            }
View Full Code Here

      // "+" oder "?" doppelt escaped werden wuerde.
      if (this.type == null || this.type.trim().length() == 0)
        return value;

      SyntaxDEFactory factory = SyntaxDEFactory.getInstance();
      SyntaxDE syntax = null;
      try
      {
        syntax = factory.createSyntaxDE(this.type,this.path,value,0,0);
        return syntax.toString(0);
      }
      finally
      {
        // Objekt wieder freigeben
        if (syntax != null)
View Full Code Here

TOP

Related Classes of org.kapott.hbci.datatypes.SyntaxDE

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.