本文整理汇总了Java中org.jinterop.dcom.core.JIString类的典型用法代码示例。如果您正苦于以下问题:Java JIString类的具体用法?Java JIString怎么用?Java JIString使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JIString类属于org.jinterop.dcom.core包,在下文中一共展示了JIString类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getState
import org.jinterop.dcom.core.JIString; //导入依赖的package包/类
public GroupState getState() throws JIException
{
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(0);
callObject.addOutParamAsType(Integer.class, JIFlags.FLAG_NULL);
callObject.addOutParamAsType(Boolean.class, JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(new JIPointer(new JIString(JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR)), JIFlags.FLAG_NULL);
callObject.addOutParamAsType(Integer.class, JIFlags.FLAG_NULL);
callObject.addOutParamAsType(Float.class, JIFlags.FLAG_NULL);
callObject.addOutParamAsType(Integer.class, JIFlags.FLAG_NULL);
callObject.addOutParamAsType(Integer.class, JIFlags.FLAG_NULL);
callObject.addOutParamAsType(Integer.class, JIFlags.FLAG_NULL);
Object[] result = comObject.call(callObject);
GroupState state = new GroupState();
state.setUpdateRate((Integer) result[0]);
state.setActive((Boolean) result[1]);
state.setName(((JIString) ((JIPointer) result[2]).getReferent()).getString());
state.setTimeBias((Integer) result[3]);
state.setPercentDeadband((Float) result[4]);
state.setLocaleId((Integer) result[5]);
state.setClientHandle((Integer) result[6]);
state.setServerHandle((Integer) result[7]);
return state;
}
示例2: getEmptyStruct
import org.jinterop.dcom.core.JIString; //导入依赖的package包/类
public static JIStruct getEmptyStruct() throws JIException
{
JIStruct struct = new JIStruct();
struct.addMember(new FileTime().getStruct()); //ftStartTime
struct.addMember(new FileTime().getStruct()); //ftCurrentTime
struct.addMember(new FileTime().getStruct()); //ftLastUpdateTime
struct.addMember(Short.class); //dwServerState
struct.addMember(Integer.class); //dwGroupCount
struct.addMember(Integer.class); //dwBandWidth
struct.addMember(Short.class); //wMajorVersion
struct.addMember(Short.class); //wMinorVersion
struct.addMember(Short.class); //wBuildNumber
struct.addMember(Short.class); //wReserved
struct.addMember(new JIPointer(new JIString(JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR))); //szVendorInfo
return struct;
}
示例3: getEmptyStruct
import org.jinterop.dcom.core.JIString; //导入依赖的package包/类
public static JIStruct getEmptyStruct() throws JIException
{
JIStruct struct = new JIStruct();
struct.addMember(new JIString(JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR));//szAccessPath
struct.addMember(new JIString(JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR));//szItemID
struct.addMember(Boolean.class);//bActive
struct.addMember(Integer.class);//hClient
struct.addMember(Integer.class);//hServer
struct.addMember(Integer.class);//dwAccessRights
struct.addMember(Integer.class);//dwBlobSize
struct.addMember(new JIPointer(new JIArray(Byte.class, null, 1, true, false))); //pBlob
struct.addMember(Short.class);//vtRequestedDataType
struct.addMember(Short.class);//vtCanonicalDataType
struct.addMember(Integer.class);//dwEUType
struct.addMember(JIVariant.class);//vEUInfo
return struct;
}
示例4: add
import org.jinterop.dcom.core.JIString; //导入依赖的package包/类
/**
* Add an {@link SWbemQualifier} object to the SWbemQualifierSet collection.
* If a qualifier with the same name already exists in the collection, it is replaced
*
* @param name Name of the new qualifier.
* @param value Variant value of the new qualifier.
* @param propagatesToSubclasses <strong>[Optional]</strong> If this new qualifier is propagated to subclasses. The default value is TRUE.
* @param propagatesToInstances <strong>[Optional]</strong> If this new qualifier is propagated to instances. The default value is TRUE.
* @param overridable <strong>[Optional]</strong> If this qualifier can be overridden when propagated. The default value is TRUE.
* @param flags <strong>[Optional]</strong> Reserved. The default value is 0.
* @return If successful, this method returns the new qualifier. Otherwise, a null object is returned.
* @throws WMIException
*/
public SWbemQualifier add(String name, WMIVariant value, Boolean propagatesToSubclasses,
Boolean propagatesToInstances, Boolean overridable, Integer flags) throws WMIException {
if(isEmpty(name)) {
throw new IllegalArgumentException("Qualifier name is empty.");
}
if(value == null || value.getVariant().equals(JIVariant.NULL())) {
throw new IllegalArgumentException("Qualifier value is null.");
}
if(flags != null && flags != 0) {
throw new IllegalArgumentException("Flags must be zero.");
}
return callMethod(SWbemQualifier.class, "Add", new JIString(name), value.getVariant(),
(propagatesToSubclasses == null) ? JIVariant.OPTIONAL_PARAM() : propagatesToSubclasses,
(propagatesToInstances == null) ? JIVariant.OPTIONAL_PARAM() : propagatesToInstances,
(overridable == null) ? JIVariant.OPTIONAL_PARAM() : overridable,
JIVariant.OPTIONAL_PARAM());
}
示例5: execQuery
import org.jinterop.dcom.core.JIString; //导入依赖的package包/类
/**
* Executes a query to retrieve objects. These objects are available through the returned
* {@link SWbemObjectSet} collection.
* @param queryString String that contains the text of the query. This parameter cannot be blank.
* For more information on building WMI query strings,
* see <a href="http://msdn.microsoft.com/en-us/library/aa392902(v=vs.85).aspx" target="_blank">Querying with WQL</a>
* and the <a href="http://msdn.microsoft.com/en-us/library/aa394606(v=vs.85).aspx" target="_blank">WQL reference</a>.
* @param queryLanguage <strong>[Optional]</strong> String that contains the query language to be used. If specified, this value must be "WQL".
* @param flags <strong>[Optional]</strong> Integer that determines the behavior of the query and determines whether this call returns immediately.
* The default value for this parameter is {@linkplain cn.chenlichao.wmi4j.consts.Flags.ExecQueryFlag#wbemFlagReturnImmediately wbemFlagReturnImmediately}.
* @param objWbemNamedValueSet <strong>[Optional]</strong> Typically, this is undefined.
* Otherwise, this is an {@link SWbemNamedValueSet} object whose elements represent the context
* information that can be used by the provider that is servicing the request.
* A provider that supports or requires such information must document the recognized
* value names, data type of the value, allowed values, and semantics.
* @return If no error occurs, this method returns an {@link SWbemObjectSet} object. This is an object collection that contains the result set of the query.
* @throws WMIException
*/
public SWbemObjectSet execQuery(String queryString, String queryLanguage, SWbemNamedValueSet objWbemNamedValueSet, Flags.ExecQueryFlag... flags) throws WMIException {
if(StringUtils.isEmpty(queryString)) {
throw new IllegalArgumentException("QueryString is empty.");
}
if(queryLanguage != null && !"WQL".equals(queryLanguage)) {
throw new IllegalArgumentException("QueryLanguage must be \"WQL\".");
}
Integer iFlags = null;
if(flags != null) {
for(Flags.ExecQueryFlag flag : flags) {
if(iFlags == null) {
iFlags = flag.getValue();
} else {
iFlags += flag.getValue();
}
}
}
return callMethod(SWbemObjectSet.class, "ExecQuery",
new JIString(queryString), JIVariant.OPTIONAL_PARAM(),
(iFlags == null) ? JIVariant.OPTIONAL_PARAM() : iFlags,
(objWbemNamedValueSet == null) ? JIVariant.OPTIONAL_PARAM() : objWbemNamedValueSet.getDispatch());
}
示例6: get
import org.jinterop.dcom.core.JIString; //导入依赖的package包/类
/**
* Retrieves an object, that is either a class definition or an instance, based on the object path.
* This method retrieves only objects from the namespace that is associated with the current SWbemServices object.
*
* @param objectPath <strong>[Optional]</strong> String that contains the object path of the object to retrieve.
* If this value is empty, the empty object that is returned can become a new class.
* @param flags <strong>[Optional]</strong> Integer that determines the behavior of the query.
* @param objWbemNamedValueSet <strong>[Optional]</strong> Typically, this is undefined.
* Otherwise, this is an {@link SWbemNamedValueSet} object whose elements represent the context
* information that can be used by the provider that is servicing the request.
* A provider that supports or requires such information must document the recognized
* value names, data type of the value, allowed values, and semantics.
* @return If successful, this method returns an {@link SWbemObject} object that represents the requested object.
* @throws WMIException
*/
public SWbemObject get(String objectPath, SWbemNamedValueSet objWbemNamedValueSet, Flags.GetFlag... flags) throws WMIException {
Integer iFlags = null;
if(flags != null) {
for(Flags.GetFlag flag : flags) {
if(iFlags == null) {
iFlags = flag.getValue();
} else {
iFlags += flag.getValue();
}
}
}
return callMethod(SWbemObject.class, "Get",
StringUtils.isEmpty(objectPath) ? JIVariant.OPTIONAL_PARAM() : new JIString(objectPath),
(iFlags == null) ? JIVariant.OPTIONAL_PARAM() : iFlags,
(objWbemNamedValueSet == null) ? JIVariant.OPTIONAL_PARAM() : objWbemNamedValueSet.getDispatch());
}
示例7: instancesOf
import org.jinterop.dcom.core.JIString; //导入依赖的package包/类
/**
* Creates an enumerator that
* returns the instances of a specified class according to the user-specified selection criteria.
* This method implements a simple query. More complex queries may require the use of
* {@linkplain #execQuery(String, String, SWbemNamedValueSet, Flags.ExecQueryFlag...) SWbemService.execQuery} method.
* @param className String that contains the name of the class for which instances are desired. This parameter cannot be blank.
* @param flags This parameter determines how detailed the call enumerates and if this call returns immediately.
* The default value for this parameter is {@linkplain cn.chenlichao.wmi4j.consts.Flags.InstancesFlag#wbemFlagReturnImmediately wbemFlagReturnImmediately}.
* @param objWbemNamedValueSet <strong>[Optional]</strong> Typically, this is undefined.
* Otherwise, this is an {@link SWbemNamedValueSet} object whose elements represent the context
* information that can be used by the provider that is servicing the request.
* A provider that supports or requires such information must document the recognized
* value names, data type of the value, allowed values, and semantics.
* @return If successful, the method returns an {@link SWbemObjectSet}.
* @throws WMIException
*/
public SWbemObjectSet instancesOf(String className, SWbemNamedValueSet objWbemNamedValueSet, Flags.InstancesFlag... flags) throws WMIException {
if(StringUtils.isEmpty(className)) {
throw new IllegalArgumentException("Class name is empty.");
}
Integer iFlags = null;
if(flags != null) {
for(Flags.InstancesFlag flag : flags) {
if(iFlags == null) {
iFlags = flag.getValue();
} else {
iFlags += flag.getValue();
}
}
}
return callMethod(SWbemObjectSet.class, "InstancesOf",
new JIString(className),
(iFlags == null) ? JIVariant.OPTIONAL_PARAM() : iFlags,
(objWbemNamedValueSet == null) ? JIVariant.OPTIONAL_PARAM() : objWbemNamedValueSet.getDispatch());
}
示例8: getClassDetails
import org.jinterop.dcom.core.JIString; //导入依赖的package包/类
/**
* Return details about a serve class
* @param clsId A server class
* @throws JIException
*/
public ClassDetails getClassDetails ( final JIClsid clsId ) throws JIException
{
if ( clsId == null )
{
return null;
}
JICallBuilder callObject = new JICallBuilder ( true );
callObject.setOpnum ( 1 );
callObject.addInParamAsUUID ( clsId.getCLSID (), JIFlags.FLAG_NULL );
callObject.addOutParamAsObject ( new JIPointer ( new JIString ( JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR ) ), JIFlags.FLAG_NULL );
callObject.addOutParamAsObject ( new JIPointer ( new JIString ( JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR ) ), JIFlags.FLAG_NULL );
Object[] result = Helper.callRespectSFALSE ( getCOMObject (), callObject );
ClassDetails cd = new ClassDetails ();
cd.setClsId ( clsId.getCLSID () );
cd.setProgId ( ( (JIString) ( (JIPointer)result[0] ).getReferent () ).getString () );
cd.setDescription ( ( (JIString) ( (JIPointer)result[1] ).getReferent () ).getString () );
return cd;
}
示例9: toStruct
import org.jinterop.dcom.core.JIString; //导入依赖的package包/类
/**
* Convert to structure to a J-Interop structure
*
* @return the j-interop structe
* @throws JIException
*/
public JIStruct toStruct () throws JIException
{
final JIStruct struct = new JIStruct ();
struct.addMember ( new JIString ( getAccessPath (), JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR ) );
struct.addMember ( new JIString ( getItemID (), JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR ) );
struct.addMember ( new Integer ( isActive () ? 1 : 0 ) );
struct.addMember ( Integer.valueOf ( getClientHandle () ) );
struct.addMember ( Integer.valueOf ( 0 ) ); // blob size
struct.addMember ( new JIPointer ( null ) ); // blob
struct.addMember ( Short.valueOf ( getRequestedDataType () ) );
struct.addMember ( Short.valueOf ( getReserved () ) );
return struct;
}
示例10: getStruct
import org.jinterop.dcom.core.JIString; //导入依赖的package包/类
public static JIStruct getStruct () throws JIException
{
JIStruct struct = new JIStruct ();
struct.addMember ( FILETIME.getStruct () );
struct.addMember ( FILETIME.getStruct () );
struct.addMember ( FILETIME.getStruct () );
struct.addMember ( Short.class ); // enum: OPCSERVERSTATE
struct.addMember ( Integer.class );
struct.addMember ( Integer.class );
struct.addMember ( Short.class );
struct.addMember ( Short.class );
struct.addMember ( Short.class );
struct.addMember ( Short.class );
struct.addMember ( new JIPointer ( new JIString ( JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR ) ) );
return struct;
}
示例11: fromStruct
import org.jinterop.dcom.core.JIString; //导入依赖的package包/类
public static OPCSERVERSTATUS fromStruct ( final JIStruct struct )
{
OPCSERVERSTATUS status = new OPCSERVERSTATUS ();
status._startTime = FILETIME.fromStruct ( (JIStruct)struct.getMember ( 0 ) );
status._currentTime = FILETIME.fromStruct ( (JIStruct)struct.getMember ( 1 ) );
status._lastUpdateTime = FILETIME.fromStruct ( (JIStruct)struct.getMember ( 2 ) );
status._serverState = OPCSERVERSTATE.fromID ( (Short)struct.getMember ( 3 ) );
status._groupCount = (Integer)struct.getMember ( 4 );
status._bandWidth = (Integer)struct.getMember ( 5 );
status._majorVersion = (Short)struct.getMember ( 6 );
status._minorVersion = (Short)struct.getMember ( 7 );
status._buildNumber = (Short)struct.getMember ( 8 );
status._reserved = (Short)struct.getMember ( 9 );
status._vendorInfo = ( (JIString) ( (JIPointer)struct.getMember ( 10 ) ).getReferent () ).getString ();
return status;
}
示例12: getDllEntry
import org.jinterop.dcom.core.JIString; //导入依赖的package包/类
public Object[] getDllEntry(int memberId, int invKind) throws JIException
{
if (invKind != InvokeKind.INVOKE_FUNC.intValue() && invKind != InvokeKind.INVOKE_PROPERTYGET.intValue()
&& invKind != InvokeKind.INVOKE_PROPERTYPUTREF.intValue() && invKind != InvokeKind.INVOKE_PROPERTYPUT.intValue())
{
throw new IllegalArgumentException(JISystem.getLocalizedMessage(JIErrorCodes.E_INVALIDARG));
}
JICallBuilder callObject = new JICallBuilder(true);
callObject.addInParamAsInt(memberId,JIFlags.FLAG_NULL);
callObject.addInParamAsInt(invKind,JIFlags.FLAG_NULL);
callObject.addInParamAsInt(1,JIFlags.FLAG_NULL);//refPtrFlags , as per the oaidl.idl...
callObject.addOutParamAsObject(new JIString(JIFlags.FLAG_REPRESENTATION_STRING_BSTR),JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(new JIString(JIFlags.FLAG_REPRESENTATION_STRING_BSTR),JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(Short.class,JIFlags.FLAG_NULL);
callObject.setOpnum(10);
return comObject.call(callObject);
}
示例13: getNames
import org.jinterop.dcom.core.JIString; //导入依赖的package包/类
public Object[] getNames(int memberId, int maxNames) throws JIException
{
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(4);
//for experiment only
// JIArray arry = new JIArray(new Integer[]{new Integer(100),new Integer(200)},true);
// JIStruct struct = new JIStruct();
// struct.addMember(Short.valueOf((short)86));
// struct.addMember(arry);
// callObject.addInParamAsStruct(struct,JIFlags.FLAG_NULL);
callObject.addInParamAsInt(memberId,JIFlags.FLAG_NULL);
callObject.addInParamAsInt(maxNames,JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(new JIArray(new JIString(JIFlags.FLAG_REPRESENTATION_STRING_BSTR),null,1,true,true),JIFlags.FLAG_NULL);
callObject.addOutParamAsType(Integer.class,JIFlags.FLAG_NULL);
return comObject.call(callObject);
}
示例14: getErrorString
import org.jinterop.dcom.core.JIString; //导入依赖的package包/类
public String getErrorString(long errorCode, int locale) throws JIException
{
JICallBuilder callObject = new JICallBuilder(true);
callObject.setOpnum(METHOD_INDEX_IOPCServer_GetErrorString);
callObject.addInParamAsInt((int) errorCode, JIFlags.FLAG_NULL);
callObject.addInParamAsInt(locale, JIFlags.FLAG_NULL);
callObject.addOutParamAsObject(new JIPointer(new JIString(JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR)), JIFlags.FLAG_NULL); // out param ppString
Object[] result = comObject.call(callObject);
if (callObject.isError())
throw new JIException(callObject.getHRESULT());
return ((JIString) ((JIPointer) result[0]).getReferent()).getString();
}
示例15: getStruct
import org.jinterop.dcom.core.JIString; //导入依赖的package包/类
public JIStruct getStruct() throws JIException
{
JIStruct struct = new JIStruct();
struct.addMember(new JIString(getAccessPath(), JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR));
struct.addMember(new JIString(getItemID(), JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR));
struct.addMember(new Integer(isActive() ? 1 : 0));
struct.addMember(Integer.valueOf(getClientHandle()));
struct.addMember(Integer.valueOf(0)); // blob size
struct.addMember(new JIPointer(null)); // blob
struct.addMember(Short.valueOf((short) getRequestedDataType()));
struct.addMember(Short.valueOf(getReserved()));
return struct;
}