📄 localstrategy.java
字号:
/**
* Copyright (c) 2002, Siddhartha P. Chandurkar siddhartha@visioncodified.com
* All rights reserved.
* Licensed under the Academic Free License version 1.1
* See the file LICENSE.TXT for details.
* LICENSE.txt is located in the directory <install-directory>\Jenerator
* of your Jenertaor Installation.
*
*/
package com.jenerator.transformer;
//<Imports>
//Java imports
import com.jenerator.struct.ConfigStructs;
import com.jenerator.struct.ejb.EntityStruct;
import com.jenerator.util.Configurator;
import org.apache.log4j.Logger;
import java.util.Vector;
//</Imports>
/**
* LocalStrategy
* This strategy implements the logic to generate local interfaces for entity beans
* It is based on the strategy pattern
* @see TransformStrategy
* @author Siddhartha P. Chandurkar
* @version 0.9.0
*
*/
public class LocalStrategy extends TransformStrategy {
//ATTRIBUTES
private static Logger log = Logger.getLogger(com.jenerator.transformer.LocalStrategy.class.getName());
//METHODS
/**
* This method overides the super class <code>transform()</code> method
*/
public void transform() throws TransformFailedException {
try {
ConfigStructs configStructs = Configurator.getInstance().getConfigStructs();
Vector ejbStructs = configStructs.getEjbStructs();
for (int i = 0; i < ejbStructs.size(); i++) {
if (ejbStructs.elementAt(i) instanceof com.jenerator.struct.ejb.EntityStruct) {
EntityStruct entityStruct = (EntityStruct) ejbStructs.elementAt(i);
if (entityStruct.getLocalGenerate().equals("yes")) {
processor.process(entityStruct.toXml(), "entitylocal.xsl", entityStruct.getLocalName() + ".java", entityStruct.getPackageDir());
processor.process(entityStruct.toXml(), "entityhome-local.xsl", entityStruct.getLocalHomeName() + ".java", entityStruct.getPackageDir());
}
}
}
} catch (NotProcessableException ex) {
log.fatal(ex);
throw new TransformFailedException(ex);
}//try
}//transform
}//LocalStrategy
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -