本文整理汇总了Java中com.helger.commons.lang.ClassHelper类的典型用法代码示例。如果您正苦于以下问题:Java ClassHelper类的具体用法?Java ClassHelper怎么用?Java ClassHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ClassHelper类属于com.helger.commons.lang包,在下文中一共展示了ClassHelper类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onAfterInstantiation
import com.helger.commons.lang.ClassHelper; //导入依赖的package包/类
@Override
protected void onAfterInstantiation (@Nonnull final IScope aScope)
{
try
{
// MPC manager before PMode manager
m_aMPCMgr = new MPCManager (MPC_XML);
m_aPModeMgr = new PModeManager (PMODE_XML);
m_aProfileMgr = new AS4ProfileManager ();
m_aIncomingDuplicateMgr = new AS4DuplicateManager (INCOMING_DUPLICATE_XML);
_initCallbacks ();
// Validate content
m_aPModeMgr.validateAllPModes ();
s_aLogger.info (ClassHelper.getClassLocalName (this) + " was initialized");
}
catch (final Throwable t)
{
throw new InitializationException ("Failed to init " + ClassHelper.getClassLocalName (this), t);
}
}
开发者ID:phax,项目名称:ph-as4,代码行数:24,代码来源:MetaAS4Manager.java
示例2: scheduleMe
import com.helger.commons.lang.ClassHelper; //导入依赖的package包/类
public static void scheduleMe (final long nDisposalMinutes)
{
if (nDisposalMinutes > 0)
{
if (!s_aScheduled.getAndSet (true))
{
final JobDataMap aJobDataMap = new JobDataMap ();
aJobDataMap.putIn (KEY_MINUTES, nDisposalMinutes);
GlobalQuartzScheduler.getInstance ()
.scheduleJob (ClassHelper.getClassLocalName (AS4DuplicateCleanupJob.class) +
"-" +
nDisposalMinutes,
JDK8TriggerBuilder.newTrigger ()
.startNow ()
.withSchedule (SimpleScheduleBuilder.repeatMinutelyForever (5)),
AS4DuplicateCleanupJob.class,
aJobDataMap);
}
// else already scheduled
}
else
{
s_aLogger.warn ("Incoming duplicate message cleaning is disabled!");
}
}
开发者ID:phax,项目名称:ph-as4,代码行数:26,代码来源:AS4DuplicateCleanupJob.java
示例3: onAfterInstantiation
import com.helger.commons.lang.ClassHelper; //导入依赖的package包/类
@Override
protected void onAfterInstantiation (@Nonnull final IScope aScope)
{
try
{
m_aLucene = new PDLucene ();
m_aStorageMgr = new PDStorageManager (m_aLucene);
m_aIndexerMgr = new PDIndexerManager (m_aStorageMgr);
m_aHttpClientMgr = new HttpClientManager ();
s_aLogger.info (ClassHelper.getClassLocalName (this) + " was initialized");
}
catch (final Throwable t)
{
if (GlobalDebug.isProductionMode ())
{
new InternalErrorBuilder ().setThrowable (t)
.addErrorMessage (ClassHelper.getClassLocalName (this) + " init failed")
.handle ();
}
throw new InitializationException ("Failed to init " + ClassHelper.getClassLocalName (this), t);
}
}
开发者ID:phax,项目名称:peppol-directory,代码行数:25,代码来源:PDMetaManager.java
示例4: getClassPathURL
import com.helger.commons.lang.ClassHelper; //导入依赖的package包/类
/**
* Get the URL for the specified path using automatic class loader handling.
* The class loaders are iterated in the following order:
* <ol>
* <li>Default class loader (usually the context class loader)</li>
* <li>The class loader of this class</li>
* <li>The system class loader</li>
* </ol>
*
* @param sPath
* The path to be resolved. May neither be <code>null</code> nor empty.
* @return <code>null</code> if the path could not be resolved.
*/
@Nullable
public static URL getClassPathURL (@Nonnull @Nonempty final String sPath)
{
ValueEnforcer.notEmpty (sPath, "Path");
// Use the default class loader. Returns null if not found
URL ret = ClassLoaderHelper.getResource (ClassLoaderHelper.getDefaultClassLoader (), sPath);
if (ret == null)
{
// This is essential if we're running as a web application!!!
ret = ClassHelper.getResource (URLHelper.class, sPath);
if (ret == null)
{
// this is a fix for a user that needed to have the application
// loaded by the bootstrap class loader
ret = ClassLoaderHelper.getResource (ClassLoaderHelper.getSystemClassLoader (), sPath);
}
}
return ret;
}
开发者ID:phax,项目名称:ph-commons,代码行数:34,代码来源:URLHelper.java
示例5: getCollectionBaseTypeOfClass
import com.helger.commons.lang.ClassHelper; //导入依赖的package包/类
@Nullable
public static ECollectionBaseType getCollectionBaseTypeOfClass (@Nullable final Class <?> aClass)
{
if (aClass != null)
{
// Query Set before Collection, because Set is derived from Collection!
if (Set.class.isAssignableFrom (aClass))
return ECollectionBaseType.SET;
if (Collection.class.isAssignableFrom (aClass))
return ECollectionBaseType.COLLECTION;
if (Map.class.isAssignableFrom (aClass))
return ECollectionBaseType.MAP;
if (ClassHelper.isArrayClass (aClass))
return ECollectionBaseType.ARRAY;
if (Iterator.class.isAssignableFrom (aClass))
return ECollectionBaseType.ITERATOR;
if (Iterable.class.isAssignableFrom (aClass))
return ECollectionBaseType.ITERABLE;
if (Enumeration.class.isAssignableFrom (aClass))
return ECollectionBaseType.ENUMERATION;
}
return null;
}
开发者ID:phax,项目名称:ph-commons,代码行数:24,代码来源:CollectionHelper.java
示例6: handle
import com.helger.commons.lang.ClassHelper; //导入依赖的package包/类
@Override
protected void handle (@Nullable final IReadableResource aRes,
@Nonnull final IErrorLevel aErrorLevel,
@Nullable final IPSElement aSourceElement,
@Nonnull final String sMessage,
@Nullable final Throwable t)
{
final SingleErrorBuilder aBuilder = SingleError.builder ()
.setErrorLevel (aErrorLevel)
.setErrorLocation (aRes == null ? null
: new SimpleLocation (aRes.getResourceID ()))
.setErrorText (sMessage)
.setLinkedException (t);
if (aSourceElement != null)
{
String sField = ClassHelper.getClassLocalName (aSourceElement);
if (aSourceElement instanceof IPSHasID && ((IPSHasID) aSourceElement).hasID ())
sField += " [ID=" + ((IPSHasID) aSourceElement).getID () + "]";
aBuilder.setErrorFieldName (sField);
}
m_aErrorList.add (aBuilder.build ());
}
开发者ID:phax,项目名称:ph-schematron,代码行数:24,代码来源:AbstractCollectingPSErrorHandler.java
示例7: onAfterInstantiation
import com.helger.commons.lang.ClassHelper; //导入依赖的package包/类
@Override
protected void onAfterInstantiation (@Nonnull final IScope aScope)
{
try
{
// TODO add managers here
// Use only the configured SML (if any)
// By default both official PEPPOL SMLs are queried!
final ISMLInfo aSML = PDServerConfiguration.getSMLToUse ();
if (aSML != null)
PDMetaManager.setBusinessCardProvider (new SMPBusinessCardProvider (aSML));
s_aLogger.info (ClassHelper.getClassLocalName (this) + " was initialized");
}
catch (final Throwable t)
{
if (GlobalDebug.isProductionMode ())
{
new InternalErrorBuilder ().setThrowable (t)
.addErrorMessage (ClassHelper.getClassLocalName (this) + " init failed")
.handle ();
}
throw new InitializationException ("Failed to init " + ClassHelper.getClassLocalName (this), t);
}
}
开发者ID:phax,项目名称:peppol-directory,代码行数:28,代码来源:PDPMetaManager.java
示例8: GlobalScope
import com.helger.commons.lang.ClassHelper; //导入依赖的package包/类
public GlobalScope (@Nonnull @Nonempty final String sScopeID)
{
super (sScopeID);
if (ScopeHelper.debugGlobalScopeLifeCycle (s_aLogger))
s_aLogger.info ("Created global scope '" + getID () + "' of class " + ClassHelper.getClassLocalName (this),
ScopeHelper.getDebugStackTrace ());
}
开发者ID:phax,项目名称:ph-commons,代码行数:9,代码来源:GlobalScope.java
示例9: preDestroy
import com.helger.commons.lang.ClassHelper; //导入依赖的package包/类
@Override
protected void preDestroy ()
{
if (ScopeHelper.debugGlobalScopeLifeCycle (s_aLogger))
s_aLogger.info ("Destroying global scope '" + getID () + "' of class " + ClassHelper.getClassLocalName (this),
ScopeHelper.getDebugStackTrace ());
}
开发者ID:phax,项目名称:ph-commons,代码行数:8,代码来源:GlobalScope.java
示例10: postDestroy
import com.helger.commons.lang.ClassHelper; //导入依赖的package包/类
@Override
protected void postDestroy ()
{
if (ScopeHelper.debugGlobalScopeLifeCycle (s_aLogger))
s_aLogger.info ("Destroyed global scope '" + getID () + "' of class " + ClassHelper.getClassLocalName (this),
ScopeHelper.getDebugStackTrace ());
}
开发者ID:phax,项目名称:ph-commons,代码行数:8,代码来源:GlobalScope.java
示例11: SessionScope
import com.helger.commons.lang.ClassHelper; //导入依赖的package包/类
public SessionScope (@Nonnull @Nonempty final String sScopeID)
{
super (sScopeID);
// Sessions are always displayed to see what's happening
if (ScopeHelper.debugSessionScopeLifeCycle (s_aLogger))
s_aLogger.info ("Created session scope '" + getID () + "' of class " + ClassHelper.getClassLocalName (this),
ScopeHelper.getDebugStackTrace ());
}
开发者ID:phax,项目名称:ph-commons,代码行数:10,代码来源:SessionScope.java
示例12: preDestroy
import com.helger.commons.lang.ClassHelper; //导入依赖的package包/类
@Override
protected void preDestroy ()
{
if (ScopeHelper.debugSessionScopeLifeCycle (s_aLogger))
s_aLogger.info ("Destroying session scope '" + getID () + "' of class " + ClassHelper.getClassLocalName (this),
ScopeHelper.getDebugStackTrace ());
}
开发者ID:phax,项目名称:ph-commons,代码行数:8,代码来源:SessionScope.java
示例13: postDestroy
import com.helger.commons.lang.ClassHelper; //导入依赖的package包/类
@Override
protected void postDestroy ()
{
if (ScopeHelper.debugSessionScopeLifeCycle (s_aLogger))
s_aLogger.info ("Destroyed session scope '" + getID () + "' of class " + ClassHelper.getClassLocalName (this),
ScopeHelper.getDebugStackTrace ());
}
开发者ID:phax,项目名称:ph-commons,代码行数:8,代码来源:SessionScope.java
示例14: RequestScope
import com.helger.commons.lang.ClassHelper; //导入依赖的package包/类
public RequestScope (@Nonnull @Nonempty final String sScopeID, @Nonnull @Nonempty final String sSessionID)
{
super (sScopeID);
m_sSessionID = ValueEnforcer.notEmpty (sSessionID, "SessionID");
// done initialization
if (ScopeHelper.debugRequestScopeLifeCycle (s_aLogger))
s_aLogger.info ("Created request scope '" + sScopeID + "' of class " + ClassHelper.getClassLocalName (this),
ScopeHelper.getDebugStackTrace ());
}
开发者ID:phax,项目名称:ph-commons,代码行数:11,代码来源:RequestScope.java
示例15: preDestroy
import com.helger.commons.lang.ClassHelper; //导入依赖的package包/类
@Override
protected void preDestroy ()
{
if (ScopeHelper.debugRequestScopeLifeCycle (s_aLogger))
s_aLogger.info ("Destroying request scope '" + getID () + "' of class " + ClassHelper.getClassLocalName (this),
ScopeHelper.getDebugStackTrace ());
}
开发者ID:phax,项目名称:ph-commons,代码行数:8,代码来源:RequestScope.java
示例16: postDestroy
import com.helger.commons.lang.ClassHelper; //导入依赖的package包/类
@Override
protected void postDestroy ()
{
if (ScopeHelper.debugRequestScopeLifeCycle (s_aLogger))
s_aLogger.info ("Destroyed request scope '" + getID () + "' of class " + ClassHelper.getClassLocalName (this),
ScopeHelper.getDebugStackTrace ());
}
开发者ID:phax,项目名称:ph-commons,代码行数:8,代码来源:RequestScope.java
示例17: toString
import com.helger.commons.lang.ClassHelper; //导入依赖的package包/类
@Override
public String toString ()
{
return new ToStringGenerator (this).append ("Value", m_aValue)
.append ("ValueClass", ClassHelper.getClassLocalName (m_aValue))
.getToString ();
}
开发者ID:phax,项目名称:ph-commons,代码行数:8,代码来源:JsonValue.java
示例18: createWithDefaultProperties
import com.helger.commons.lang.ClassHelper; //导入依赖的package包/类
/**
* Create a standard {@link ObjectName} using the default domain and only the
* "type" property. The type property is the class local name of the specified
* object.
*
* @param aObj
* The object from which the name is to be created.
* @return The non-<code>null</code> {@link ObjectName}.
*/
@Nonnull
public static ObjectName createWithDefaultProperties (@Nonnull final Object aObj)
{
ValueEnforcer.notNull (aObj, "Object");
final Hashtable <String, String> aParams = new Hashtable<> ();
aParams.put (CJMX.PROPERTY_TYPE, ClassHelper.getClassLocalName (aObj));
return create (aParams);
}
开发者ID:phax,项目名称:ph-commons,代码行数:19,代码来源:ObjectNameHelper.java
示例19: _addItem
import com.helger.commons.lang.ClassHelper; //导入依赖的package包/类
/**
* Add or update an item. Must only be invoked inside a write-lock.
*
* @param aItem
* The item to be added or updated
* @param eActionType
* The action type. Must be CREATE or UPDATE!
* @throws IllegalArgumentException
* If on CREATE an item with the same ID is already contained. If on
* UPDATE an item with the provided ID does NOT exist.
*/
@MustBeLocked (ELockType.WRITE)
private void _addItem (@Nonnull final IMPLTYPE aItem, @Nonnull final EDAOActionType eActionType)
{
ValueEnforcer.notNull (aItem, "Item");
ValueEnforcer.isTrue (eActionType == EDAOActionType.CREATE || eActionType == EDAOActionType.UPDATE,
"Invalid action type provided!");
final String sID = aItem.getID ();
final IMPLTYPE aOldItem = m_aMap.get (sID);
if (eActionType == EDAOActionType.CREATE)
{
if (aOldItem != null)
throw new IllegalArgumentException (ClassHelper.getClassLocalName (getDataTypeClass ()) +
" with ID '" +
sID +
"' is already in use and can therefore not be created again. Old item = " +
aOldItem +
"; New item = " +
aItem);
}
else
{
// Update
if (aOldItem == null)
throw new IllegalArgumentException (ClassHelper.getClassLocalName (getDataTypeClass ()) +
" with ID '" +
sID +
"' is not yet in use and can therefore not be updated! Updated item = " +
aItem);
}
m_aMap.put (sID, aItem);
}
开发者ID:phax,项目名称:ph-commons,代码行数:45,代码来源:AbstractMapBasedWALDAO.java
示例20: FactoryNewInstance
import com.helger.commons.lang.ClassHelper; //导入依赖的package包/类
public FactoryNewInstance (@Nullable final Class <? extends DATATYPE> aClass, final boolean bCheckInstancable)
{
if (bCheckInstancable)
ValueEnforcer.isTrue (ClassHelper.isInstancableClass (aClass),
() -> "The passed class '" +
aClass +
"' is not instancable or doesn't have a public no-argument constructor!");
m_aClass = aClass;
}
开发者ID:phax,项目名称:ph-commons,代码行数:10,代码来源:FactoryNewInstance.java
注:本文中的com.helger.commons.lang.ClassHelper类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论